Skip to content

Conversation

@Definisi
Copy link

@Definisi Definisi commented Dec 9, 2025

Fixes #2136. When assigning a read-only property to a read-write property type, the error message now includes information about the property attributes. Previously, the error would say number is not a subtype of number which was confusing. Now it clearly states that the property is read-only in the former type but read-write in the latter type, making it obvious why the subtyping check failed.

…pe mismatch errors

When assigning a read-only property to a read-write property type, the error
message now includes information about the property attributes, making it clear
that the subtyping check failed because the property is read-only in the former
type but read-write in the latter type.

Example error message:
'accessing hello results in
umber in the former type (where hello is read-only)
and
umber in the latter type (where hello is read-write)'
…type pack instantiation

When extra types are materialized into a type pack during function type
instantiation, the type pack needs to be properly structured for generalization.
This fix ensures that extra types are handled correctly before calling
instantiateFunctionType, similar to how saturateArguments handles them.

Fixes assertion failure: isKnown(params.polarity) in Generalization.cpp
@PhoenixWhitefire
Copy link
Contributor

PhoenixWhitefire commented Dec 10, 2025

Thanks!

image

Oh my, that's quite the chain!

Also, I think you need to put these changes under a FFlag, but I'm not sure

@Definisi
Copy link
Author

Definisi commented Dec 10, 2025

Thanks!

image Oh my, that's quite the chain!

Also, I think you need to put these changes under a FFlag, but I'm not sure

HAHAHAHAH I was just trying to fix it first
I’ll check later about putting it behind an FFlag. Thanks for pointing it out :D

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Assigning read-only to a read-write type produces "T is not a subtype of T" error without read-write attribute information

2 participants