-
Notifications
You must be signed in to change notification settings - Fork 28
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
#2956. Update and rename existing tests for type void
#2978
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good!
I'm tempted to suggest that each of the situations where void
is tested to get a specific treatment is followed up by a test which is identical, except that it uses typedef Void = void;
. The purely syntactic cases should then allow Void
to be used, but other places (like the implements clause of a class / ... / an extension type) would need to expand the type alias, find void
, and report the error for that.
This could be done in these tests, or it could be a separate set of test libraries, in this PR or in another one, whatever is more convenient.
I commented on several cases where a compile-time error is expected, and it is a syntax error, and nothing says "syntax". I think it's useful (for future readers in particular) to explicitly mention that they are syntax errors, because syntax errors behave so differently from other errors. E.g., we would never even attempt to answer questions like "how many syntax errors does this email have, considered as a Dart program?". Also, we can't put several syntax errors together in the same test library, for the same reason.
In short, developers who read (not to mention maintain) tests involving syntax errors should be aware of the fact that they are syntax errors.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added notes that some compile errors are actually syntax errors and also added tests for type alias of void
. PTAL.
Fix typo (written by eernstg)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
2024-11-25 sgrekhov22@gmail.com Fixes dart-lang/co19#2994. Fix a typo in type_void_A06_t11.dart (dart-lang/co19#2995) 2024-11-25 sgrekhov22@gmail.com dart-lang/co19#2559. Fix wrong assertion text in augmenting_constructors_A18_*.dart (dart-lang/co19#2993) 2024-11-25 sgrekhov22@gmail.com dart-lang/co19#2976. Add grammar tests (dart-lang/co19#2990) 2024-11-25 sgrekhov22@gmail.com Fixes dart-lang/co19#2991. Fix typos and separate tests with `external` (dart-lang/co19#2992) 2024-11-25 sgrekhov22@gmail.com dart-lang/co19#2559. Update assertions for some Augmenting libraries tests (dart-lang/co19#2989) 2024-11-21 sgrekhov22@gmail.com dart-lang/co19#2119. Update assertion texts in Wildcards tests (dart-lang/co19#2981) 2024-11-20 sgrekhov22@gmail.com dart-lang/co19#2956. Add more type `void` and `dynamic` tests (dart-lang/co19#2987) 2024-11-20 sgrekhov22@gmail.com dart-lang/co19#2979. Update existing and add new tests checking nnbd static errors (dart-lang/co19#2984) 2024-11-20 sgrekhov22@gmail.com dart-lang/co19#2979. Fix CFE failures in nnbd weak-mode tests (dart-lang/co19#2988) 2024-11-19 sgrekhov22@gmail.com dart-lang/co19#2956. Update and rename existing tests for type `void` (dart-lang/co19#2978) 2024-11-19 sgrekhov22@gmail.com dart-lang/co19#2559. Update assertions in some Augmenting libraries tests (dart-lang/co19#2986) 2024-11-19 sgrekhov22@gmail.com Fixes dart-lang/co19#2983. Change expected error in generic_parameter_inference_A01_t05.dart (dart-lang/co19#2985) 2024-11-18 sgrekhov22@gmail.com dart-lang/co19#2979. Update NNBD static errors tests. Part 2 (dart-lang/co19#2982) 2024-11-15 sgrekhov22@gmail.com dart-lang/co19#2979. Update NNBD static errors tests (dart-lang/co19#2980) Cq-Include-Trybots: luci.dart.try:analyzer-linux-release-try Change-Id: Ib1dcad2edfa7c6fdd996c6db94173bec91e68368 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/397340 Commit-Queue: Alexander Thomas <athom@google.com> Reviewed-by: Alexander Thomas <athom@google.com> Reviewed-by: Erik Ernst <eernst@google.com>
No description provided.