-
Notifications
You must be signed in to change notification settings - Fork 755
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
[Spec Deviation] Freezing a container should narrow its inherent type to a type that consists of just its current shape #13189
Comments
@MaryamZi Please verify this w.r.t 2019R3 |
IMO, this is still valid. The 2019R3 spec says
|
Following code runs fine now with v1-0-0-alpha3 pack. Do we need any fixes here?
|
Yeah, this scenario seems to work fine. Even though we don't change the inherent type, since most updates are done by first checking However as mentioned in #15278 (comment), typeof should return a singleton type representing the shape of the value if it is immutable. This is not implemented yet, and we have to do one of the following
|
Description:
According to the spec (v0.990:2019-01-16 - page 17), "A frozen container value belongs to a type if and only if the type contains the shape of the value. Thus after a container value is frozen, its inherent type does not provide additional information that cannot be derived from the value. In other words, freezing a container narrows its inherent type to a type that consists of just its current shape"
The
is
check works as expected after freezing a value:But when trying to use such a value in the context of the narrowed type, the original type is still considered.
Casting/assertion also fails similarly.
Affected Versions:
0.990.2
The text was updated successfully, but these errors were encountered: