Type Inference fails when choosing between Party and AnonymousParty.

Description

A change introduced by https://r3-cev.atlassian.net/browse/CID-878 has exposed a type inference limitation in the compiler that is unfortunately hit by one of our samples. introduces a Destination interface that is implemented by both AnonymousParty and Party. Both of these subclass AbstractParty. The sample in question uses a variable that is conditionally one of AnonymousParty or Party, depending on whether a flag is set. This variable is only used as an AbstractParty. Without the extra Destination interface, the compiler can infer this with no further annotation, however the addition of this interface confuses the compiler and causes it to treat the variable as Any - which then breaks when an attempt is made to use it as an AbstractParty.

Assignee

James Higgs

Reporter

James Higgs

Labels

Sprint

None

Epic Link

None

Priority

Highest

Engineering Teams

None

Fix versions

Affects versions

Ported to...

Corda 4.3
Corda Enterprise 4.3

Story Points / Dev Days

2

Build cut

None
Configure