Skip to content

[Enhanced-parts] No error in the analyzer when parts have different language versions #61845

@sgrekhov

Description

@sgrekhov

There is no error in the analyzer in the following cases.

  1. main.dart has // @dart=3.11
    part1.dart part of main.dart has // @dart=3.11
    part2.dart part of part1.dart has // @dart=3.10

  2. main.dart has // @dart=3.10
    part1.dart part of main.dart has // @dart=3.10
    part2.dart part of part1.dart has // @dart=3.11

  3. main.dart has // @dart=3.11
    part1.dart part of main.dart has // @dart=3.11
    part2.dart part of part1.dart has no language marker

  4. main.dart has no language marker
    part1.dart part of main.dart has no language marker
    part2.dart part of part1.dart has // @dart=3.11

There should be a compile-time error in all of the cases above (and this error is reported by CFE).

Dart SDK version: 3.11.0-edge.47f4ff25b7639c765156df145b131373e24f6652 (main) (Sun Oct 26 15:14:41 2025 -0700) on "linux_x64"

Metadata

Metadata

Assignees

Labels

area-dart-modelFor issues related to conformance to the language spec in the parser, compilers or the CLI analyzer.feature-enhanced-partsRegarding the 'enhanced-parts' featuremodel-featuresGeneral feature work in the analyzer and CFE.

Type

No type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions