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

[WIP] update typescript, fix strict function types errors #645

Closed
wants to merge 2 commits into
base: master
from

Conversation

Projects
None yet
3 participants
@goloveychuk
Copy link

goloveychuk commented Dec 7, 2018

With this pr you can compile with strictFunctionTypes enabled, with no error.
In some places added any, trying to fix this.
fixes #72

@goloveychuk goloveychuk changed the title [WIPupdate typescript, fix strict function types errors [WIP] update typescript, fix strict function types errors Dec 7, 2018

@goloveychuk goloveychuk force-pushed the goloveychuk:strict-function-types branch from ac376d0 to b132368 Dec 7, 2018

@goloveychuk

This comment has been minimized.

Copy link
Author

goloveychuk commented Dec 7, 2018

looks like the root problem of almost all errors is

class A {
  cont!: () => keyof this
  
  prop!: string
}

class B extends A { 
  additionalProp!: string
}

let a: A = new B() // error

which is basically the same as

class A {
  cont2!: () => 'prop'
  
  prop!: string
}

class B extends A {
  cont2: () => 'prop' | 'additionalProp' // forbidden extension
  
  additionalProp!: string
}

let a: A = new B()
@Pauan

This comment has been minimized.

Copy link
Collaborator

Pauan commented Dec 7, 2018

@goloveychuk Thanks a lot for this! I'll be doing a thorough code review soon.

@Pauan Pauan self-assigned this Dec 9, 2018

@goloveychuk

This comment has been minimized.

Copy link
Author

goloveychuk commented Dec 20, 2018

@Pauan any news?

@rkovalyov

This comment has been minimized.

Copy link

rkovalyov commented Dec 21, 2018

@Pauan when u will be able to review, we a looking forward for this changes ?

@Pauan

This comment has been minimized.

Copy link
Collaborator

Pauan commented Dec 21, 2018

@goloveychuk @rkovalyov Yeah, sorry, I've been reviewing it, but it's slow going since it's a lot of changes (and I've had to work on some other things in the meantime).

@Pauan

This comment has been minimized.

Copy link
Collaborator

Pauan commented Jan 13, 2019

I've incorporated most of your changes, could you please rebase and resolve the conflicts?

Also, could you please make sure that it compiles successfully with TypeScript 2.8.1 (the oldest version we support)?

@Pauan

This comment has been minimized.

Copy link
Collaborator

Pauan commented Jan 13, 2019

Nevermind, I was able to fix the conflicts.

We use a different repo for our development, so I can't merge this as-is, but I incorporated your changes, and they will show up in the next release.

You have been given credit for your work. Thank you very much!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment