-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
ntuple
doesn't handle Int32
s well during struct Construction.
#57271
Comments
what should the error message be here? probably |
This may be related, and is not just a problem with error messages:
|
Related: #57189. Fixing it would make the stack trace here more informative. |
Prior to v1.3 this gave an error when the type was constructed. Now, we let you form the type but the field type that didn't work is IIRC, this was done to fix a soundness issue where failing to construct a type led subtyping to conclude the type was uninhabited, and so field types could affect the subtype relation even though they really shouldn't. I don't have a specific example of the problem at hand unfortunately. I agree this is not ideal. Jameson had a helpful idea in the commit message:
I think another option is to examine the error when we print it, and reconstruct the problem by trying to instantiate each field type and seeing if it fails, so we can give that information to the user. |
It wasn't exactly correctness but rather that we don't compute fieldtypes eagerly anymore, so we cannot throw an exception at the time that we instantiated that type. To expound upon Jeff's noted improvement: we could potentially inject a bit of code at the start of each new call which checks if the fields are actually all inhabited and throw a better exception if we see that it is not |
MWE:
incurs into a:
Also fails with an inner constructor.
Versioninfo:
The text was updated successfully, but these errors were encountered: