Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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 dart-lang/language#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>
- Loading branch information