Open eernstg opened 4 days ago
You do read it correctly. It might be a bit weird, but I think it is also fairly easy to rationalize/explain.
I do also think we should allow doc comments and metadata.
Agree that it can be explained. You can augment either the implicit getter, the implicit setter or the initializer expressions. Those are distinct entities, and are augmented independently.
The augmentation specification seems to allow the following configuration:
The following sentence in the specification justifies this situation, in the section about 'Augmenting a getter and/or setter with a variable':
My reading of this would be that the variable
x
is initialized to have the value 3, and an evaluation ofx
would then yield 4. In other words,augmented
at the second level of augmentation refers to the original, not the first level of augmentation.Isn't that somewhat surprising? :grinning:
If we do continue to allow this then we should probably also allow adding a DartDoc comment and/or metadata (#3957).