Skip to content

[CFE] Definitions from main library are not visible in augmentation library #55103

Open
@sgrekhov

Description

@sgrekhov

According to the Augmentation libraries spec

Declarations in any augmentation or the main library are visible to all of the others, including private ones.

But definitions from the main library are not visible in augmentation lib in CFE

// main_lib.dart
// SharedOptions=--enable-experiment=macros

import augment 'augh_lib.dart';

class C1 {
  String get y => "y";
}

// augh_lib.dart
// SharedOptions=--enable-experiment=macros

library augment 'main_lib.dart';

main() {
  print(C1); // Analyzer: Ok. CFE: Error: Undefined name 'C1'.
}

Tested on Dart SDK version: 3.4.0-194.0.dev (dev) (Sat Mar 2 00:04:28 2024 -0800) on "windows_x64"

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions