#3182. Update extension_types_*.dart tests#3462
Conversation
There was a problem hiding this comment.
A whole bunch of tests here make an attempt to augment the primary constructor of an extension type using a normal in-body constructor declaration. I'm convinced that the language team will want this to be an error (there are too many special exceptions with primary constructors in extension types).
Perhaps this PR should be marked as blocked until this has been clarified further.
Edit: The language team actually discussed this in dart-lang/language#3177, so we rely on the outcome there. This means that a primary constructor can be augmented by a regular in-body constructor, but the primary constructor or the in-body constructor must be incomplete (we can't have two complete declarations in the same augmentation chain), and the in-body constructor can't have declaring parameters, so it's almost impossible to avoid that the primary constructor is the complete one.
sgrekhov
left a comment
There was a problem hiding this comment.
Ok, let's mark it as blocked until specification update.
|
Thanks! |
eernstg
left a comment
There was a problem hiding this comment.
Let's revive this one. It is OK for a regular in-body constructor declaration to augment a primary constructor after all (dart-lang/language#3177).
|
Reviewed, updated some descriptions. Looks like ready for review to me. Please review. |
eernstg
left a comment
There was a problem hiding this comment.
Just one question about a tiny source of confusion.
|
Updated. PTAL. |
2026-02-12 [email protected] dart-lang/co19#3182. Fix/update tests for primary constructors (dart-lang/co19#3616) 2026-02-11 [email protected] dart-lang/co19#3182. Add tests for augmentation of primary constructors. Part 2. (dart-lang/co19#3611) 2026-02-11 [email protected] Fixes dart-lang/co19#3612. Replace WARNING.X_Y_Z by STATIC_STATIC_WARNING.X_Y_Z (dart-lang/co19#3613) 2026-02-10 [email protected] dart-lang/co19#3608. Update primary constructor tests (dart-lang/co19#3610) 2026-02-10 [email protected] dart-lang/co19#3182. Add tests for augmenting primary constructors (dart-lang/co19#3606) 2026-02-10 [email protected] dart-lang/co19#3182. Remove duplicated tests for extension types (dart-lang/co19#3609) 2026-02-09 [email protected] dart-lang/co19#3182. Add tests for augmentation of primary constructors (dart-lang/co19#3607) 2026-02-06 [email protected] dart-lang/co19#3182. Update `extension_types_*.dart` tests (dart-lang/co19#3462) 2026-02-06 [email protected] dart-lang/co19#3182. Add new test for `async`, `async*` and `sync*` functions (dart-lang/co19#3568) 2026-02-06 [email protected] dart-lang/co19#3602. Add more tests for primary constructors (dart-lang/co19#3603) [email protected], [email protected] Cq-Include-Trybots: luci.dart.try:analyzer-linux-release-try,dart2js-minified-linux-d8-try Change-Id: I42f2f90acd34e02bc8ecdae34ee1b46bf699a2c2 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/480920 Commit-Queue: Johnni Winther <[email protected]> Reviewed-by: Erik Ernst <[email protected]> Auto-Submit: Sergey Grekhov <[email protected]> Reviewed-by: Johnni Winther <[email protected]>
No description provided.