Open scheglov opened 2 years ago
That is as intended(-ish). The support for augment class
was originally added like the support macro class
, but further development showed that augment class
(for now) is only need in augmentation libraries. For this reason, augment class
is now only supported when the scanner is configured for augmentation libraries, in which augment
is treated as a modifier, whereas macro class
is supported when the macros
experimental flag is enabled.
OK, thank you.
This is inconvenient with the way analyzer works - we can parse a file not knowing initially how it will be referenced later. And it feels inconsistent with the way language version works, which allows you to set @dart = x.y
in parts, but will check that it is the same as in the library.
So, for now in the analyzer I will enable augment
anywhere when the macros
feature is enabled.
https://dart-review.googlesource.com/c/sdk/+/242660
...
augment class
(for now) is only need in augmentation libraries.
How do we know that an arbitrary file is an augmentation library? Is there a file naming convention?
Currently we only read these files knowing that they are augmentation libraries.
The general discussion of how to identify these is in https://github.com/dart-lang/language/issues/2120
Thank you for the pointer.
But
macro class A {}
can.