Skip to content

CFE seems to omit the scope that enables generic function types to have F-bounds #36870

Closed
@iarkh

Description

@iarkh

Dart SDK Version: 2.3.0-dev.0.5
OS: Windows 10 64 bit

The following source example declares a typedef AAlias with Function in the right part:

class A<X extends A<X>> {}
typedef AAlias = Function<X extends A<X>> ();
main() { print("OK"); }

Dart throws a compile time error here whereas analyzer passes without any errors or warnings. Sample output is:

$> dartanalyzer test.dart
$> dart test.dart
test.dart:2:39: Error: Type 'X' not found.
typedef AAlias = Function<X extends A> ();
$>

Seems like analyzer should throw an error here too.

Metadata

Metadata

Assignees

No one assigned

    Labels

    legacy-area-front-endLegacy: Use area-dart-model instead.type-bugIncorrect behavior (everything from a crash to more subtle misbehavior)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions