Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No error in the analyzer if augment class goes before original class #55295

Open
sgrekhov opened this issue Mar 25, 2024 · 2 comments
Open

No error in the analyzer if augment class goes before original class #55295

sgrekhov opened this issue Mar 25, 2024 · 2 comments
Assignees
Labels
area-analyzer Use area-analyzer for Dart analyzer issues, including the analysis server and code completion. feature-macros Implementation of the macros feature P2 A bug or feature request we're likely to work on type-bug Incorrect behavior (everything from a crash to more subtle misbehavior)

Comments

@sgrekhov
Copy link
Contributor

According to the specification

It is a compile-time error if:
...

  • An augmenting declaration appears in a library before the library where the original declaration occurs, according to merge order.

See https://github.com/dart-lang/co19/blob/master/LanguageFeatures/Augmentation-libraries/merge_order_A01_t02.dart
There is no this error in the analyzer

// merge_order_A01_t02.dart
import augment 'merge_order_A01_t02_lib1.dart';

augment class A {} // No expected error
//            ^
// [analyzer] unspecified
// [cfe] unspecified

// merge_order_A01_t02_lib1.dart
library augment 'merge_order_A01_t02.dart'; // The new syntax is augment library, I know

class A {
}
@sgrekhov sgrekhov added area-analyzer Use area-analyzer for Dart analyzer issues, including the analysis server and code completion. feature-macros Implementation of the macros feature labels Mar 25, 2024
@keertip keertip added type-bug Incorrect behavior (everything from a crash to more subtle misbehavior) P2 A bug or feature request we're likely to work on labels Mar 26, 2024
@keertip
Copy link
Contributor

keertip commented Mar 26, 2024

/cc @scheglov

@scheglov scheglov self-assigned this Mar 26, 2024
copybara-service bot pushed a commit that referenced this issue Mar 27, 2024
Bug: #55295
Change-Id: I50811e1ccd7a2be0e71b18eefa9ecb76ac1aef73
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/359961
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
@davidmorgan
Copy link
Contributor

I guess this can be closed? @scheglov thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-analyzer Use area-analyzer for Dart analyzer issues, including the analysis server and code completion. feature-macros Implementation of the macros feature P2 A bug or feature request we're likely to work on type-bug Incorrect behavior (everything from a crash to more subtle misbehavior)
Projects
None yet
Development

No branches or pull requests

4 participants