Skip to content
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

Playground missing strictBindCallApply #12

Closed
orta opened this issue Jul 10, 2019 · 2 comments
Closed

Playground missing strictBindCallApply #12

orta opened this issue Jul 10, 2019 · 2 comments
Labels
Playground Issues that affect the Playground

Comments

@orta
Copy link
Contributor

orta commented Jul 10, 2019

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

class Class {
  prop = "foo";
  method() {
    return this.prop;
  }
}

const instance = new Class();

const boundMethod = instance.method.bind(instance); // any
boundMethod - 7; // no error
const boundMethod2 = instance.method.bind<() => string>(instance); // error
// bind is not generic   ---------------> ~~~~~~~~~~~~

Expected behavior:
boundMethod should be strongly typed as () => string

Actual behavior:
boundMethod is any

Playground Link:
Playground Link

Related Issues:
https://github.com/orta/typescript-play/issues/11 microsoft/TypeScript#27028: introduction of --strictBindCallApply

@orta orta added Playground Issues that affect the Playground and removed Playground Issues that affect the Playground labels Jul 10, 2019
@jcalz
Copy link

jcalz commented Aug 30, 2019

Announcing TypeScript 3.6

The new playground now supports many new options including:

  • All the strictness flags (including just strict)

Me: 😭 [cries in --strictBindCallApply]

@orta
Copy link
Contributor Author

orta commented Oct 3, 2019

This is in with. #76 👍

@orta orta closed this as completed Oct 3, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Playground Issues that affect the Playground
Projects
None yet
Development

No branches or pull requests

2 participants