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

Labels

Priority

Highest

Fix versions

Ported to...

Corda 4.3
Corda Enterprise 4.3

Feature Team

Corda Core

CVSS Vector

None

Severity

Medium

Story Points

2

Sprint

None

Affects versions

Configure