Skip to content

Fail to infer types of members in on classes. #51123

Open
@Cat-sushi

Description

@Cat-sushi

With implicit-dynamic: false analysis option,
Dart SDK version: 2.19.0 (stable) (Unknown timestamp) on "linux_x64"
fails to infer types of members in on classes.

2.18.6 or former version of SDK didn't report any issue.

Missing field type for 'md'.
Try adding an explicit type, or remove implicit-dynamic from your analysis options file.dart(implicit_dynamic_field)
class C {
  double d = 0.0;
}

mixin M on C {
  late final md = d;
}

class C2 extends C with M {
}

void main(){
  var c = C2();
  print(c.md);
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3A lower priority bug or feature requestarea-dart-modelFor issues related to conformance to the language spec in the parser, compilers or the CLI analyzer.dart-model-analyzer-specIssues with the analyzer's implementation of the language specstrict-analysis-neededMark issues where strict-raw-types, strict-inference and similar analysis options were helpfultype-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