mirror of
https://github.com/dart-lang/sdk
synced 2024-11-05 18:22:09 +00:00
0ae2ac1277
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> |
||
---|---|---|
.. | ||
simple | ||
assign_to_promoted_record_test.dart | ||
const_keys_test.dart | ||
regress52593_test.dart | ||
regress54375_test.dart |