-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Bug: A context property on a machine blows away actor input type checking #5209
Comments
Maybe another interesting version of types getting wonked in this case: it also stops checking the context types: |
Yeah it's really weird that the presence of a nested type error disables the expected "missing Something else I noticed while playing around with your examples is that the type of
ts playground example of the above. And if we modify your first example a tiny bit, we can see that the above holds true. When This switch between inferred and assigned type seems to be the difference in whether an error is thrown on |
XState version
XState version 5
Description
My actor inputs are typechecked until I add a context function to my machine, and then they're no longer typechecked. ts playground has reproduction
Expected result
I think the
ts-expect-error
should be correct regardless of if thecontext
function is being set.Actual result
Reproduction
https://www.typescriptlang.org/play/?ts=5.6.3#code/JYWwDg9gTgLgBAbzgZwKYwK5gDRwGZQQgAKhIwacAvvmXAEQAeyMAhjKvQNxwD0vcGAE8wqZAC44AVgB0ARgAcMgEwAoVcNFwAwhAB2HRvAC8iOBAwcokllGB6A5tS7qAxvpZwQrVwAt7qHCmaJhgABQIqnCCImKSCDSsyIhR0XDuBqhGkrqZRi5pcPZgljn6hjAF1NipPjDQEimFACYQAMqYeHiSBESkRBSoYamFSUJ6rnARRXol8FTxM3OL9nqo1nB6GCAARuvU1ACUQQB8TYVpUOgYUHpwALLsvjJQrHqtIGHHANRLljKrdZVQpUEZwQ41aJUGpUQ4yVxXdioR5+AIRVL8OAASTwcCEFnSRBAqAM5ksgn8yQANgFcDBfIFNIE-KhXABrexOfQUwJ1aBwADu0DZyVYDlY9lSGQqkmmxXJsNOfxgkJmADcIGzUPEwcgoK5JPRWh0MF16KrovKYDqLnwBAABGDIAC0WVErhgrqghCgYOirTEBgAoowKNaGHgIBBzX6ZmsNlIwdDUsnYS4gA
Additional context
No response
The text was updated successfully, but these errors were encountered: