Created
October 11, 2019 05:30
-
-
Save richard-viney/757366efa584cc7c3351d32eb11c293f to your computer and use it in GitHub Desktop.
Type checking error upgrading from TypeScript 3.5 to 3.6
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import EmberObject, { set } from "@ember/object" | |
class Foo extends EmberObject { | |
public version!: number | |
} | |
class Bar extends EmberObject { | |
public version!: number | |
public name!: string // Note: removing this line makes the error below go away | |
} | |
function test(a: Foo | Bar) { | |
// Global set type checks correctly, no problems here | |
set(a, "version", 1) | |
// But using .set() gives `error TS2349: This expression is not callable.` | |
a.set("version", 1) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This is still happening with TypeScript 3.7.2.