Skip to content

Comments

#3182. Update extension_types_*.dart tests#3462

Merged
eernstg merged 7 commits intodart-lang:masterfrom
sgrekhov:co19-3182-54
Feb 6, 2026
Merged

#3182. Update extension_types_*.dart tests#3462
eernstg merged 7 commits intodart-lang:masterfrom
sgrekhov:co19-3182-54

Conversation

@sgrekhov
Copy link
Contributor

No description provided.

Copy link
Member

@eernstg eernstg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Contributor Author

@sgrekhov sgrekhov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, let's mark it as blocked until specification update.

@sgrekhov sgrekhov added the status-blocked Blocked from making progress by another (referenced) issue label Jan 7, 2026
@eernstg
Copy link
Member

eernstg commented Jan 8, 2026

Thanks!

@eernstg eernstg removed the status-blocked Blocked from making progress by another (referenced) issue label Feb 4, 2026
Copy link
Member

@eernstg eernstg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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).

@sgrekhov
Copy link
Contributor Author

sgrekhov commented Feb 6, 2026

Reviewed, updated some descriptions. Looks like ready for review to me. Please review.

@sgrekhov sgrekhov requested a review from eernstg February 6, 2026 10:05
Copy link
Member

@eernstg eernstg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just one question about a tiny source of confusion.

@sgrekhov
Copy link
Contributor Author

sgrekhov commented Feb 6, 2026

Updated. PTAL.

Copy link
Member

@eernstg eernstg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@eernstg eernstg merged commit db5ac45 into dart-lang:master Feb 6, 2026
2 of 3 checks passed
copybara-service bot pushed a commit to dart-lang/sdk that referenced this pull request Feb 16, 2026
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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants