-
Notifications
You must be signed in to change notification settings - Fork 8
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
false equality with exactOptionalPropertyTypes #128
Comments
Thanks - yeah, I haven't actually used this config so not sure if it's solvable either. If you've seen any ts tricks around that can detect the difference, I'd be open to a (non-breaking) update here. |
By the way, TypeScript's internal programmatic API also confirms that these types are identical. With or without In a way, I would say that’s correct. These types are identical. (But not assignable, if I say so after thinking, if taking (And assignability is another story. But again: does it matter to check whether TypeScript works correctly? That’s like testing a constant. Obviously with Just thinking out loud. Might be this is simplified example and I have missed some detail. EDIT. On second thought, I see how assignably checks could make sense. |
I'm not too familiar with the Compiler API but isn't it weird though, for types to be considered equal but not be assignable? |
In a way it sounds strange. I was digging through internal TypeScript's logic, looking at AST and type objects. Hm.. Not sure I still agree with my yesterday’s thoughts ;D A fix could be: after checking identically, compare assignability as well. Don’t know how to translate that into generic types. Programmatically that’s simple: tstyche/tstyche#357 By the way, |
I'm a little late to the party, I'm going to see if there is a simple solution to this. |
Not sure if this solvable, but
.toEqualTypeOf()
doesn't work correctly with theexactOptionalPropertyTypes
config option.The last line results in the following error message:
Playground
The text was updated successfully, but these errors were encountered: