Skip to content

analyzer issue with inference involving record types #59918

@mraleph

Description

@mraleph

Analyzer rejects the following program because it infers T to be Object?:

void main() {
  f(('',), (v) { print(v.length); });
}

void f<T>((T,) v, void Function(T) fn) {
  fn(v.$1);
}

CFE infers String and accepts the program. @eernstg thinks CFE is correct.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2A bug or feature request we're likely to work onlegacy-area-analyzerUse area-devexp 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