-
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
#1399. [Records] Subtyping tests for records added #1412
Conversation
Hi @sgrekhov, @chloestefantsova and I agreed to distribute the reviews based on odd/even numbers: I'll take the even ones, such as #1412. |
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.
Checked a bunch of things, did not notice any serious issues. In some tests the top-level variable t1Instance
is declared but never used, and some occurrences of forgetType
seem to be unnecessary.
However, I'd need to take a look at the files used to generate all these libraries in order to see how all the small differences make sense. Where do I find those?
LanguageFeatures/Subtyping/dynamic/generated/records_arguments_binding_A01_t01.dart
Show resolved
Hide resolved
LanguageFeatures/Subtyping/dynamic/generated/records_arguments_binding_A01_t01.dart
Show resolved
Hide resolved
LanguageFeatures/Subtyping/dynamic/generated/records_arguments_binding_A01_t01.dart
Show resolved
Hide resolved
LanguageFeatures/Subtyping/dynamic/generated/records_arguments_binding_A01_t02.dart
Show resolved
Hide resolved
LanguageFeatures/Subtyping/dynamic/generated/records_arguments_binding_A02_t01.dart
Show resolved
Hide resolved
LanguageFeatures/Subtyping/dynamic/generated/records_arguments_binding_A03_t03.dart
Show resolved
Hide resolved
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.
@eernstg these generated files are produced from files in LanguageFeatures/Subtyping/test_types/
. Here we define test types T0
and T1
and instance variables t0Instance
and t1Instance
.
Then test generator takes "test cases" defined in LanguageFeatures/Subtyping/dynamic/test_cases
and LanguageFeatures/Subtyping/static/test_cases
where types T0
and T1
are checked if T0
is subtype of T1
or not, using t0Instance
and t1Instance
. Generated tests arуe Cartesian product of these files
LanguageFeatures/Subtyping/dynamic/generated/records_arguments_binding_A01_t02.dart
Show resolved
Hide resolved
LanguageFeatures/Subtyping/dynamic/generated/records_arguments_binding_A03_t03.dart
Show resolved
Hide resolved
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.
OK, now I understand much better how this works: The libraries you mention ('LanguageFeatures/Subtyping/test_types/records_*.dart') are simply choosing the types to test, and then the generator generates a large number of code constructs where the given types are made subject to a subtype test (that occurs at compile time or at run time).
I haven't looked at the generator in detail, so this review will only be concerned with those basic libraries where the types are chosen.
They look fine, except that I suggested a few typo fixes in the @description
. We might as well fix this now, to avoid having a large number of copies of those typos. ;-)
Co-authored-by: Erik Ernst <eernst@google.com>
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.
Thanks! LGTM. Landing.
2022-09-02 sgrekhov22@gmail.com dart-lang/co19#1399. on clause tests added (dart-lang/co19#1416) 2022-09-02 sgrekhov22@gmail.com dart-lang/co19#1399. [Records] Type annotations and record expressions tests updated (dart-lang/co19#1415) 2022-09-01 sgrekhov22@gmail.com Fixes dart-lang/co19#1398. Fix tests that use unreachable code after `Never` (dart-lang/co19#1402) 2022-08-31 sgrekhov22@gmail.com dart-lang/co19#1399. [Records] Typos in subtyping tests description fixed (dart-lang/co19#1414) 2022-08-31 sgrekhov22@gmail.com dart-lang/co19#1399. [Records] Subtyping tests for records added (dart-lang/co19#1412) 2022-08-31 asashour@yahoo.com Fix typo (dart-lang/co19#1413) 2022-08-30 sgrekhov22@gmail.com dart-lang/co19#1405. BytesBuilder tests moved from dart:io to dart:typed_data (dart-lang/co19#1410) 2022-08-30 sgrekhov22@gmail.com dart-lang/co19#1399. Tests for record types. Part 1 (dart-lang/co19#1395) 2022-08-24 sgrekhov22@gmail.com dart-lang/co19#1405. Don't use deprecated API in co19 tests. Update generated files (dart-lang/co19#1407) 2022-08-24 sgrekhov22@gmail.com dart-lang/co19#1405. Don't use deprecated API in co19 tests (dart-lang/co19#1406) 2022-08-23 sgrekhov22@gmail.com Fixes dart-lang/co19#1361. Private fields promotion tests added (dart-lang/co19#1391) 2022-08-23 sgrekhov22@gmail.com Fixes dart-lang/co19#1394. Add missing compile-error (dart-lang/co19#1396) 2022-08-23 sgrekhov22@gmail.com Fixes dart-lang/co19#1403. Added test that `super` cannot be used as an expression (dart-lang/co19#1404) 2022-08-15 sgrekhov22@gmail.com dart-lang/co19#1388. FFI tests fixed for 32-bit systems (dart-lang/co19#1392) 2022-08-11 sgrekhov22@gmail.com dart-lang/co19#1388. FFI test failures fixed (dart-lang/co19#1389) Change-Id: I2eee6c193eed1ce8a511f3ef5667ded947fbfad8 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/257700 Reviewed-by: Alexander Thomas <athom@google.com>
Please review files in
LanguageFeatures/Subtyping/test_types/
folder. Files in this folder defines records types which then tested in different ways (as a return values, as a type arguments etc). Don't review all 100+ generated files