-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
The issue with the order of inference #57591
Comments
|
My meaning is to wait for the inference to complete. |
That's not a thing |
We really need a minimzied repro; there's a lot going on here that doesn't seem germane to the issue being described |
I removed some of the code. type EventType = number | string | symbol;
type Events<T> = { [N: EventType]: ((context: T, ...args: any[]) => void) };
function define<
Data extends object = {},
>(options: {
data?: Data,
magic?: (a: Data) => void,
interceptor?: NoInfer<Events<Data>>, // NoInfer is required to ensure the correct type of jjjj.a.
}) { };
define({
data: ({
bbbb: true,
gggg: () => { },
kkkk() { // If this function is commented out, magic is not needed
this.bbbb
this.kkkk
},
}),
// magic() { }, // error
// magic(a) { }, // ok
interceptor: {
'jjjj'(context, a) {
// ^?
context.bbbb
context.gggg
context.kkkk
},
asd(context, a) {
},
},
}); |
Duplicate #47599 |
This issue has been marked as "Duplicate" and has seen no recent activity. It has been automatically closed for house-keeping purposes. |
π Search Terms
Infer, Generics
π Version & Regression Information
5.5.0-dev.20240229
β― Playground Link
https://www.typescriptlang.org/play?ts=5.5.0-dev.20240229#code/C4TwDgpgBAogbhAdsAKuaBeKiCuBbAIwgCcoAfKAZ2GIEtEBzcqkQgewBsBuAKFElgJkAeTDBabRJShYA3gF9e-aPCTAAIhADGHAIbFd4ydKwAlbW2IATADy7EIADRR7IANoBdAHxL0gtZQ2PFAhUCiOwaEwEaGwMFAQAB7ASFbSqsiaOvqGElIysAnJqelCGtp6Bkb5APyFAGRQslBuygBc-shokB4drp5Q8lAdza3oHRmo6L0uDgPyPF4FspEhbgByUPRQANYQIGwAZnEeNR0AFOdakinJHeEJZaLVlBNPYnmUzgB0v-oMrziGw8AEoZEs4GxaFYQbwho0UAALWiUboQGyQ6E+Hg8Q44RBaapQKwQQ70dGrKDqQy6IopRBpKBsAgAK20wGW8hioQAshBgIi2IykvTGeZrtY7A5nAAxfGEvJLORcyniiC0OC6AgcaAikqdcrZKqfTnckIASSkwHsWkwVJpUEafIFQq+i3ObA+xhGlMQujwEA61DojDNUGUlDOTUpsTVGq1Oqjcc12ogYZVlKsNKj1OtYYDLrSUedgsZCORqPQNkt1BtEC8+d0DFoWij510HRr1oJEDBGAhUKsYfoKWItrElij6zYlsOJBsk0CXbrzmTCfrDagAHot1Bp7OSFtpMQIABHHC0E9WcNsBJSHAn8OI6ASk+E8N+I5QFk-lnfXTfDw8hgs0ig4iSZKIBA5wrLEfoBh0ADkugoYhYYRj6sSxto6opjqIxDLo0iwVhpGIRAZSIR0nhhqRISIb+LJUS0HbYPgRDEB4tF0YhWh8VozFuAQQY0PQDBcTGPH8VoACMgnCVQomMBJdGDOmYZZtaFwkaRBB6QpNA4GmkkhAwZkMBcfZLKB3EhDs9k7OcIEhDuUDmscAoolAeIEkSXnXHgAbIBA15sDgwDOHgTYtke2BsByUEhSFJlYZ5lDfPpBApbEaXfA5OwpSqsTAWGrlRc2WhOU0anbruiC3pS5Utu2zlcrVUAgBAlCUiOJDjsAliYTxjGIVcNwis4novM4uggdlqkLaErkAHo1PNITXMFyQZfp61QJttzAN85kMHtB0inlDmFbZLiUFYY1bRFTJelIM1zapRWhCqwFcEAA
π» Code
π Actual behavior
The magic function must be added and must have parameters to be error-free.
π Expected behavior
No magic function is needed.
Perhaps an explicit command could be added to ensure waiting for certain parameter inferences to complete?
Additional information about the issue
No response
The text was updated successfully, but these errors were encountered: