TypeScript Version: 2.4.0 / nightly (2.5.0-dev.20170621)
Code
interface IPerson {
name: string;
birthday?: Date;
}
class Person implements IPerson { }
Expected behavior:
The quick fix suggestion for "Implement interface 'IPerson'" shows up.
Actual behavior:
The quick fix bulb doesn't light up.
Explanation
The optional property birthday? seems to crash and breaks the "implement interface" auto-fix for the rest of the project, and it doesn't start working again unless I restart VS Code.
If I change it to birthday: Date;, the auto-fix works consistently as expected.
If I read this right, this is the corresponding piece from tsserver.log:
Exception on executing command {"seq":9,"type":"request","command":"getCodeFixes","arguments":{"file":"...","startLine":31,"endLine":31,"startOffset":7,"endOffset":13,"errorCodes":[2420]}}:
Debug Failure. False expression: position cannot precede the beginning of the file
Error: Debug Failure. False expression: position cannot precede the beginning of the file
at Object.computeLineAndCharacterOfPosition (.../node_modules/typescript/lib/tsserver.js:9935:22)
TypeScript Version: 2.4.0 / nightly (2.5.0-dev.20170621)
Code
Expected behavior:
The quick fix suggestion for "Implement interface 'IPerson'" shows up.
Actual behavior:
The quick fix bulb doesn't light up.
Explanation
The optional property
birthday?seems to crash and breaks the "implement interface" auto-fix for the rest of the project, and it doesn't start working again unless I restart VS Code.If I change it to
birthday: Date;, the auto-fix works consistently as expected.If I read this right, this is the corresponding piece from
tsserver.log: