Skip to content

LUB does not consider generic function types to be equivalent #39534

@nshahan

Description

@nshahan

I'm creating this issue to track so we know when it is safe to cleanup our workaround in the NNBD fork of the SDK. It came up from an email thread with @johnniwinther. The issues with LUB is compounded when nullability is added to the function types.

Repro:

typedef F1 = R Function<R>()?;

f() {
  R Function<R>()? a;
  R Function<R>()? b;
  F1 c = a ?? b;
}

Errors:

repro.dart:6:12: Error: A value of type 'Object Function()' can't be assigned to a variable of type 'R Function<R>()'.
 - 'Object' is from 'dart:core'.
  F1 c = a ?? b;

Metadata

Metadata

Labels

NNBDIssues related to NNBD Releaselegacy-area-front-endLegacy: Use area-dart-model instead.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions