Skip to content

Incorrect type inference when using call in Records #3558

Closed
@rrousselGit

Description

@rrousselGit

Consider the following:

final foo = (call: <T>(T value) => value,);
final value = foo<int>(42);

Currently, the type of value is inferred as dynamic. But this is incorrect.

Screenshot 2024-01-13 at 19 04 01

Writing: final value = foo.call<int>(42) fixes the type-inference issue.

Screenshot 2024-01-13 at 19 04 16

Metadata

Metadata

Assignees

No one assigned

    Labels

    featureProposed language feature that solves one or more problems

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions