dart-sdk/tests/language/records
Paul Berry 0ae2ac1277 Language test of record demotion behavior.
When a local variable is promoted to a record type, and then an
assignment statement is used to assign a record literal to that local
variable, if the fields of the new record literal are not assignable
to the fields of the promoted record type, that's not a problem; both
the analyzer and front end agree that the local variable is simply
demoted.

But the spec implies that if the old and new record _shapes_ are the
same, then a compile-time error will occur instead of a demotion. I've
created https://github.com/dart-lang/language/pull/3613 to bring the
spec in line with the implementations. This test demonstrates the
current behavior of the implementations, and makes sure that it
doesn't regress.

Change-Id: I0eacd7ca7f6579a35dbc34687113a2112418f368
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/352462
Reviewed-by: Bob Nystrom <rnystrom@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2024-02-13 23:28:19 +00:00
..
simple [tests] Remove obsolete Dart 3.0 experiments from language tests 2023-06-15 08:26:27 +00:00
assign_to_promoted_record_test.dart Language test of record demotion behavior. 2024-02-13 23:28:19 +00:00
const_keys_test.dart [test] Test for records as keys in const collections 2023-06-14 00:59:37 +00:00
regress52593_test.dart [tests] Add void value in record regression test 2023-06-08 23:54:23 +00:00
regress54375_test.dart [ddc] Fix broken named record elements 2023-12-21 19:23:04 +00:00