You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Looks like the new Playground doesn't have the --strictBindCallApply compiler option available. It seems suboptimal that we can't do the equivalent of --strict in the Playground (and has caused a few issues when trying to reproduce issues or share code in Stack Overflow that rely on this functionality)
classClass{prop="foo";method(){returnthis.prop;}}constinstance=newClass();constboundMethod=instance.method.bind(instance);// anyboundMethod-7;// no errorconstboundMethod2=instance.method.bind<()=>string>(instance);// error// bind is not generic ---------------> ~~~~~~~~~~~~
Expected behavior: boundMethod should be strongly typed as () => string
Looks like the new Playground doesn't have the
--strictBindCallApply
compiler option available. It seems suboptimal that we can't do the equivalent of--strict
in the Playground (and has caused a few issues when trying to reproduce issues or share code in Stack Overflow that rely on this functionality)I guess I'm opening this here instead of at microsoft/TypeScript, or at agentcooper/typescript-play, but please tell me if this should be moved. Thanks!
Code
Expected behavior:
boundMethod
should be strongly typed as() => string
Actual behavior:
boundMethod
isany
Playground Link:
Playground Link
Related Issues:
https://github.com/orta/typescript-play/issues/11 microsoft/TypeScript#27028: introduction of
--strictBindCallApply
The text was updated successfully, but these errors were encountered: