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 to augment different type #55293

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

No error in the analyzer to augment different type #55293

sgrekhov opened this issue Mar 25, 2024 · 0 comments
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

sgrekhov commented Mar 25, 2024

According to the augmentation libraries specification

It is a compile-time error if:

  • The augmenting type and corresponding type are not the same kind: class, mixin, enum, extension, or extension type. You can't augment a class with a mixin, etc.

But the analyzer doesn't report this error. See https://github.com/dart-lang/co19/blob/master/LanguageFeatures/Augmentation-libraries/augmenting_types_A01_t02.dart

// augmenting_types_A01_t02.dart

import augment 'augmenting_types_A01_t02_lib1.dart';

class C {}

typedef CAlias = C;

// augmenting_types_A01_t02_lib1.dart
library augment 'augmenting_types_A01_t02.dart'; // I know that the new syntax is `augment library ...`

augment mixin CAlias {} // No expected error
//            ^^^^^^
// [analyzer] unspecified
// [cfe] unspecified

Tested on the edge SDK (March 25, 2024)

@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
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
Development

No branches or pull requests

2 participants