This was we don't get noisy baselines just because a different phase of the compiler reported the diagnostic. This helps with Yui's refactoring work to move grammar checks into the type checker.
46 lines
No EOL
1.6 KiB
Text
46 lines
No EOL
1.6 KiB
Text
tests/cases/compiler/primitiveMembers.ts(5,3): error TS2339: Property 'toBAZ' does not exist on type 'number'.
|
|
tests/cases/compiler/primitiveMembers.ts(11,1): error TS2322: Type 'Number' is not assignable to type 'number'.
|
|
tests/cases/compiler/primitiveMembers.ts(24,35): error TS1068: Unexpected token. A constructor, method, accessor, or property was expected.
|
|
tests/cases/compiler/primitiveMembers.ts(25,56): error TS1068: Unexpected token. A constructor, method, accessor, or property was expected.
|
|
|
|
|
|
==== tests/cases/compiler/primitiveMembers.ts (4 errors) ====
|
|
var x = 5;
|
|
var r = /yo/;
|
|
r.source;
|
|
|
|
x.toBAZ();
|
|
~~~~~
|
|
!!! error TS2339: Property 'toBAZ' does not exist on type 'number'.
|
|
x.toString();
|
|
|
|
var n = 0;
|
|
var N: Number;
|
|
|
|
n = N; // should not work, as 'number' has a different brand
|
|
~
|
|
!!! error TS2322: Type 'Number' is not assignable to type 'number'.
|
|
N = n; // should work
|
|
|
|
var o: Object = {}
|
|
var f: Function = (x: string) => x.length;
|
|
var r2: RegExp = /./g;
|
|
var n2: Number = 34;
|
|
var s: String = "yo";
|
|
var b: Boolean = true;
|
|
|
|
var n3 = 5 || {};
|
|
|
|
|
|
class baz { public bar(): void { }; }
|
|
~
|
|
!!! error TS1068: Unexpected token. A constructor, method, accessor, or property was expected.
|
|
class foo extends baz { public bar(){ return undefined}; }
|
|
~
|
|
!!! error TS1068: Unexpected token. A constructor, method, accessor, or property was expected.
|
|
|
|
|
|
|
|
|
|
|
|
|