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

#2559. Add tests for augment libraries visibility #2561

Merged
merged 7 commits into from
Apr 9, 2024

Conversation

sgrekhov
Copy link
Contributor

@sgrekhov sgrekhov commented Mar 6, 2024

No description provided.

@sgrekhov sgrekhov requested review from eernstg, athomas and chloestefantsova and removed request for athomas March 6, 2024 07:19
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.

Looks good!

I would hope that we could use the augmented ("owner") library as the entry point in every case, because I'm arguing that it should just be an error to execute an augmentation library (dart-lang/language#3642).

(That's a messy feature, anyway.)

Doesn't the test runner support detecting errors that occur in some other file than the library which is specified as "the library to execute" (i.e., the entry point)? Just checking, https://dart-review.googlesource.com/c/sdk/+/345541 has been merged. I would think that this makes it possible to use the augmented library as "the file to execute" every time.

@sgrekhov
Copy link
Contributor Author

sgrekhov commented Mar 7, 2024

Doesn't the test runner support detecting errors that occur in some other file than the library which is specified as "the library to execute" (i.e., the entry point)? Just checking, https://dart-review.googlesource.com/c/sdk/+/345541 has been merged. I would think that this makes it possible to use the augmented library as "the file to execute" every time.

Test runner doesn't support expecting errors in augmentation now. Therefore, some tests from this PR fails in spite of that augmentation has expected error it anyway reported as unexpected. Do we have any plans for supporting expected errors in augmentations?

@sgrekhov
Copy link
Contributor Author

Ok, now test runner does support expected errors in augmented libraries. This change is ready for review now

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.

Looks good, with a couple of typos.

One thing came up: I think it would be useful to use an imported namespace in one case, because there could be a kind of bug where unused import namespaces are sort of ignored, and then we could get a successful test run for the wrong reason. ;-)


library augment 'defining_augmentation_A02_t04.dart';

import 'augmentation_libraries_lib.dart';
Copy link
Member

Choose a reason for hiding this comment

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

Perhaps this was intended?:

Suggested change
import 'augmentation_libraries_lib.dart';
import 'augmentation_libraries_lib.dart';
export 'augmentation_libraries_lib.dart';

Copy link
Member

Choose a reason for hiding this comment

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

Perhaps use AL in this library, just to make sure that the import really occurs (importing into an augmentation library may be new code in the tools, so maybe they could do nothing for an import which isn't used).

Copy link
Member

Choose a reason for hiding this comment

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

I looked at LanguageFeatures/Augmentation-libraries/defining_augmentation_A02_t04.dart and concluded from the @description that there should be an export somewhere, and this was the only location where it would fit, as far as I could see.

On the other hand, the @description in this file does not mention any exports. Maybe the description should be adjusted in one or the other file?

@sgrekhov
Copy link
Contributor Author

Thank you! Updated. Please take another look

@sgrekhov sgrekhov requested a review from eernstg March 11, 2024 11:05
@sgrekhov
Copy link
Contributor Author

sgrekhov commented Apr 9, 2024

PR updated, library augment... replaced by augment library.... Please review

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.

Looks good! I did notice that a couple of review comments were still lingering, so I looked at them again. Looks like they're still relevant, so it would probably be useful to take another look, perhaps I missed something.


library augment 'defining_augmentation_A02_t04.dart';

import 'augmentation_libraries_lib.dart';
Copy link
Member

Choose a reason for hiding this comment

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

I looked at LanguageFeatures/Augmentation-libraries/defining_augmentation_A02_t04.dart and concluded from the @description that there should be an export somewhere, and this was the only location where it would fit, as far as I could see.

On the other hand, the @description in this file does not mention any exports. Maybe the description should be adjusted in one or the other file?

@sgrekhov
Copy link
Contributor Author

sgrekhov commented Apr 9, 2024

Thank you. Updated

@sgrekhov sgrekhov requested a review from eernstg April 9, 2024 08:37
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 425e7ef into dart-lang:master Apr 9, 2024
2 checks passed
copybara-service bot pushed a commit to dart-lang/sdk that referenced this pull request Apr 15, 2024
2024-04-15 [email protected] Fixes dart-lang/co19#2609. Fix runtime failure and typos (dart-lang/co19#2610)
2024-04-15 [email protected] Fixes dart-lang/co19#2606. Fix the new roll failures (dart-lang/co19#2608)
2024-04-15 [email protected] dart-lang/co19#2559. Add tests for `augmented()` expression (dart-lang/co19#2601)
2024-04-12 [email protected] Fixes dart-lang/co19#2604. Fix new roll failures, add issues numbers (dart-lang/co19#2605)
2024-04-12 [email protected] Fixes dart-lang/co19#2602. Fix new roll failures (dart-lang/co19#2603)
2024-04-11 [email protected] dart-lang/co19#2559. Add extensions to augmenting types tests (dart-lang/co19#2600)
2024-04-10 [email protected] dart-lang/co19#2559. Add augmenting functions tests (dart-lang/co19#2599)
2024-04-10 [email protected] dart-lang/co19#2559. Add tests for operators (dart-lang/co19#2598)
2024-04-09 [email protected] dart-lang/co19#2559. Add more augmenting types tests (dart-lang/co19#2596)
2024-04-09 [email protected] dart-lang/co19#2559. Make enum augmenting types tests stronger (dart-lang/co19#2597)
2024-04-09 [email protected] dart-lang/co19#2559. Add tests for augment libraries visibility (dart-lang/co19#2561)
2024-04-09 [email protected] dart-lang/co19#2559. Add augmenting types tests. Part 3 (dart-lang/co19#2570)
2024-04-08 [email protected] dart-lang/co19#2559. Update/add new defining augmentation tests (dart-lang/co19#2595)
2024-04-08 [email protected] dart-lang/co19#2559. Add more augmenting types tests for `with` clause (dart-lang/co19#2594)
2024-04-05 [email protected] Update Symbol tests documentation (dart-lang/co19#2593)
2024-04-05 [email protected] dart-lang/co19#2559. Add more augmenting types tests for `on` clause (dart-lang/co19#2592)
2024-04-05 [email protected] dart-lang/co19#2559. Add more augmenting types tests for `extends` and `implements` clauses (dart-lang/co19#2591)

Change-Id: I7e5c91f71535f69fe628460d89c227a54080533e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/362803
Reviewed-by: Alexander Thomas <[email protected]>
Reviewed-by: Jonas Termansen <[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