jeffreymorlan
jeffreymorlan
You can constrain a type variable to a primitive type like `number` (useful for a function intended to work on multiple different enum types), but you get an error upon...
Recursive data structure type alias "circularly references itself" only if used before declaration
var x: StringTree; ``` type StringTree = string | StringTreeArray; interface StringTreeArray extends Array {} ``` This code gets a "Type alias 'StringTree' circularly references itself." error. I believe it...
In 1.5, `export =` is not emitted if the symbol is a const-enum-only module. However, in any of the following cases, a const-enum-only module actually does have a runtime value...
``` ts abstract class A { abstract foo(): void; } class B extends A { } // error, does not implement foo var C = class extends A { };...
From `programUpToDate` in services/services.ts: ``` // If number of files in the program do not match, it is not up-to-date let rootFileNames = hostCache.getRootFileNames(); if (program.getSourceFiles().length !== rootFileNames.length) { return...
In the following code: ``` var base = class {}; class C extends base {} ``` services does not recognize that the `base` identifier in the second line refers to...
Type-checking the following (broken) program: ``` class C { if (a) {} else if (0) {} } ``` results in an assertion error: ``` Error: Debug Failure. False expression: at...
A.ts: ``` ts class A { method() {} } export = A; ``` B.ts: ``` ts import A = require('A'); new A().method(); ``` When using code completion on the .method...
``` ts module SomeModule { export class SomeClass {} } import M = SomeModule; // or import M = require(...) import C = M.SomeClass; ``` On the `M` identifier in...
This works in 1.7: ``` ts var a: {}; if (typeof a === 'number') { var b: number = a; } ``` but in the master branch, `a` is not...