We're updating the issue view to help you get more done. 

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.

Status

Assignee

James Higgs

Reporter

James Higgs

Priority

Highest

Labels

Severity

Medium

Fix versions

Ported to...

None

Feature Team

Corda Core

Sprint

Affects versions

Corda 4.3