Skip to content

[augmentations] No error in case of use augmented constant in a control-flow collections if and for #57053

@sgrekhov

Description

@sgrekhov

Any use of an augmented variable in an augmenting function is an error. But there are no expected errors in the analyzer in the code below.

const augmented = 1;

void topLevelFunction() {}

augment void topLevelFunction() {
  var map = {
    for (var i = 0; i > augmented;) i: i
//                      ^^^^^^^^^
// [analyzer] unspecified
// [cfe] unspecified
  };
  var set = {
    if (1 > augmented) 42
//          ^^^^^^^^^
// [analyzer] unspecified
// [cfe] unspecified
  };
}

Appropriate co19 test is https://github.com/dart-lang/co19/blob/master/LanguageFeatures/Augmentation-libraries/augmented_expression_A10_t21.dart

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2A bug or feature request we're likely to work onarea-dart-modelFor issues related to conformance to the language spec in the parser, compilers or the CLI analyzer.feature-augmentationsImplementation of the augmentations feature

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions