mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-15 12:51:30 -05:00
Reassigned diagnostic codes.
This commit is contained in:
@@ -6,6 +6,6 @@
|
||||
|
||||
export = B;
|
||||
~~~~~~~~~~~
|
||||
!!! An export assignment cannot be used in a module with other exported elements.
|
||||
!!! Cannot find name 'B'.
|
||||
~~~~~~~~~~~
|
||||
!!! Cannot find name 'B'.
|
||||
!!! An export assignment cannot be used in a module with other exported elements.
|
||||
@@ -3,9 +3,9 @@
|
||||
~~~~~~~~~~~
|
||||
!!! Cannot compile external modules unless the '--module' flag is provided.
|
||||
~~~~~~~~~~~
|
||||
!!! An export assignment cannot be used in a module with other exported elements.
|
||||
~~~~~~~~~~~
|
||||
!!! Cannot find name 'B'.
|
||||
~~~~~~~~~~~
|
||||
!!! An export assignment cannot be used in a module with other exported elements.
|
||||
|
||||
export class C {
|
||||
}
|
||||
@@ -3,9 +3,9 @@
|
||||
// Arrow function used in with statement
|
||||
with (window) {
|
||||
~~~~~~
|
||||
!!! All symbols within a 'with' block will be resolved to 'any'.
|
||||
~~~~~~
|
||||
!!! Cannot find name 'window'.
|
||||
~~~~~~
|
||||
!!! All symbols within a 'with' block will be resolved to 'any'.
|
||||
var p = () => this;
|
||||
}
|
||||
|
||||
@@ -54,9 +54,9 @@
|
||||
// Arrow function used in with statement
|
||||
with (window) {
|
||||
~~~~~~
|
||||
!!! All symbols within a 'with' block will be resolved to 'any'.
|
||||
~~~~~~
|
||||
!!! Cannot find name 'window'.
|
||||
~~~~~~
|
||||
!!! All symbols within a 'with' block will be resolved to 'any'.
|
||||
var p = () => this;
|
||||
}
|
||||
|
||||
|
||||
@@ -9,9 +9,9 @@
|
||||
|
||||
function Foo(); // error
|
||||
~~~
|
||||
!!! Function implementation is missing or not immediately following the declaration.
|
||||
~~~
|
||||
!!! Duplicate identifier 'Foo'.
|
||||
~~~
|
||||
!!! Function implementation is missing or not immediately following the declaration.
|
||||
function F1(s:string);
|
||||
function F1(a:any) { return a;}
|
||||
|
||||
|
||||
@@ -7,17 +7,17 @@
|
||||
interface Derived extends Base {
|
||||
1: { y: number } // error
|
||||
~~~~~~~~~~~~~~~~
|
||||
!!! Property '1' of type '{ y: number; }' is not assignable to numeric index type '{ x: number; y: number; }'.
|
||||
~~~~~~~~~~~~~~~~
|
||||
!!! Property '1' of type '{ y: number; }' is not assignable to string index type '{ x: number; }'.
|
||||
~~~~~~~~~~~~~~~~
|
||||
!!! Property '1' of type '{ y: number; }' is not assignable to numeric index type '{ x: number; y: number; }'.
|
||||
}
|
||||
|
||||
interface Derived2 extends Base {
|
||||
'1': { y: number } // error
|
||||
~~~~~~~~~~~~~~~~~~
|
||||
!!! Property ''1'' of type '{ y: number; }' is not assignable to numeric index type '{ x: number; y: number; }'.
|
||||
~~~~~~~~~~~~~~~~~~
|
||||
!!! Property ''1'' of type '{ y: number; }' is not assignable to string index type '{ x: number; }'.
|
||||
~~~~~~~~~~~~~~~~~~
|
||||
!!! Property ''1'' of type '{ y: number; }' is not assignable to numeric index type '{ x: number; y: number; }'.
|
||||
}
|
||||
|
||||
interface Derived3 extends Base {
|
||||
|
||||
@@ -8,9 +8,9 @@
|
||||
~
|
||||
!!! Type parameter list cannot be empty.
|
||||
~
|
||||
!!! Type parameter declaration expected.
|
||||
~
|
||||
!!! '(' expected.
|
||||
~
|
||||
!!! Type parameter declaration expected.
|
||||
};
|
||||
~
|
||||
!!! Expression expected.
|
||||
@@ -69,9 +69,9 @@
|
||||
module M {
|
||||
module F {
|
||||
~
|
||||
!!! A module declaration cannot be located prior to a class or function with which it is merged
|
||||
~
|
||||
!!! Individual declarations in merged declaration F must be all exported or all local.
|
||||
~
|
||||
!!! A module declaration cannot be located prior to a class or function with which it is merged
|
||||
var t;
|
||||
}
|
||||
export function F() { } // Only one error for duplicate identifier (don't consider visibility)
|
||||
|
||||
@@ -3,9 +3,9 @@
|
||||
export class MemberName <A,B,C>{
|
||||
static create<A,B,C>(arg1: any, arg2?: any, arg3?: any): MemberName {
|
||||
~~~~~~~~~~
|
||||
!!! A function whose declared type is neither 'void' nor 'any' must return a value or consist of a single 'throw' statement.
|
||||
~~~~~~~~~~
|
||||
!!! Generic type 'MemberName<A, B, C>' requires 3 type argument(s).
|
||||
~~~~~~~~~~
|
||||
!!! A function whose declared type is neither 'void' nor 'any' must return a value or consist of a single 'throw' statement.
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -25,16 +25,16 @@
|
||||
|
||||
interface F extends A, B, E { } // error because 0 is not a subtype of {a; b;}
|
||||
~
|
||||
!!! Property '0' of type '{}' is not assignable to numeric index type '{ a: any; b: any; }'.
|
||||
~
|
||||
!!! Property '0' of type '{}' is not assignable to string index type '{ a: any; }'.
|
||||
~
|
||||
!!! Property '0' of type '{}' is not assignable to numeric index type '{ a: any; b: any; }'.
|
||||
|
||||
interface G extends A, B, C, E { } // should only report one error
|
||||
~
|
||||
!!! Property '0' of type '{}' is not assignable to numeric index type '{ a: any; b: any; }'.
|
||||
~
|
||||
!!! Property '0' of type '{}' is not assignable to string index type '{ a: any; }'.
|
||||
~
|
||||
!!! Property 'm' of type '{}' is not assignable to string index type '{ a: any; }'.
|
||||
~
|
||||
!!! Property '0' of type '{}' is not assignable to numeric index type '{ a: any; b: any; }'.
|
||||
|
||||
interface H extends A, F { } // Should report no error at all because error is internal to F
|
||||
@@ -18,9 +18,9 @@
|
||||
!!! Property 'a' of type '{ toString: () => {}; }' is not assignable to string index type 'Object'.
|
||||
return 1;
|
||||
~~~~~~
|
||||
!!! Property or signature expected.
|
||||
~~~~~~
|
||||
!!! A 'return' statement can only be used within a function body.
|
||||
~~~~~~
|
||||
!!! Property or signature expected.
|
||||
};
|
||||
~
|
||||
!!! Declaration or statement expected.
|
||||
|
||||
@@ -3,34 +3,34 @@
|
||||
foo();
|
||||
static foo(); // error
|
||||
~~~
|
||||
!!! Function implementation is missing or not immediately following the declaration.
|
||||
~~~
|
||||
!!! Function overload must not be static.
|
||||
~~~
|
||||
!!! Function implementation is missing or not immediately following the declaration.
|
||||
}
|
||||
|
||||
class D {
|
||||
static foo();
|
||||
foo(); // error
|
||||
~~~
|
||||
!!! Function implementation is missing or not immediately following the declaration.
|
||||
~~~
|
||||
!!! Function overload must be static.
|
||||
~~~
|
||||
!!! Function implementation is missing or not immediately following the declaration.
|
||||
}
|
||||
|
||||
class E<T> {
|
||||
foo(x: T);
|
||||
static foo(x: number); // error
|
||||
~~~
|
||||
!!! Function implementation is missing or not immediately following the declaration.
|
||||
~~~
|
||||
!!! Function overload must not be static.
|
||||
~~~
|
||||
!!! Function implementation is missing or not immediately following the declaration.
|
||||
}
|
||||
|
||||
class F<T> {
|
||||
static foo(x: number);
|
||||
foo(x: T); // error
|
||||
~~~
|
||||
!!! Function implementation is missing or not immediately following the declaration.
|
||||
~~~
|
||||
!!! Function overload must be static.
|
||||
~~~
|
||||
!!! Function implementation is missing or not immediately following the declaration.
|
||||
}
|
||||
@@ -6,6 +6,6 @@
|
||||
|
||||
export = B;
|
||||
~~~~~~~~~~~
|
||||
!!! An export assignment cannot be used in a module with other exported elements.
|
||||
!!! Cannot find name 'B'.
|
||||
~~~~~~~~~~~
|
||||
!!! Cannot find name 'B'.
|
||||
!!! An export assignment cannot be used in a module with other exported elements.
|
||||
@@ -3,9 +3,9 @@
|
||||
~~~~~~~~~~~
|
||||
!!! Cannot compile external modules unless the '--module' flag is provided.
|
||||
~~~~~~~~~~~
|
||||
!!! An export assignment cannot be used in a module with other exported elements.
|
||||
~~~~~~~~~~~
|
||||
!!! Cannot find name 'B'.
|
||||
~~~~~~~~~~~
|
||||
!!! An export assignment cannot be used in a module with other exported elements.
|
||||
|
||||
export class C {
|
||||
}
|
||||
@@ -1,9 +1,9 @@
|
||||
==== tests/cases/conformance/parser/ecmascript5/Statements/parserForStatement3.ts (7 errors) ====
|
||||
for(d in _.jh[a]=_.jh[a]||[],b);
|
||||
~
|
||||
!!! The left-hand side of a 'for...in' statement must be of type 'string' or 'any'.
|
||||
~
|
||||
!!! Cannot find name 'd'.
|
||||
~
|
||||
!!! The left-hand side of a 'for...in' statement must be of type 'string' or 'any'.
|
||||
~
|
||||
!!! Cannot find name '_'.
|
||||
~
|
||||
|
||||
@@ -30,9 +30,9 @@
|
||||
|
||||
function f2(): F<T> {
|
||||
~~~~
|
||||
!!! A function whose declared type is neither 'void' nor 'any' must return a value or consist of a single 'throw' statement.
|
||||
~~~~
|
||||
!!! Cannot find name 'F'.
|
||||
~~~~
|
||||
!!! A function whose declared type is neither 'void' nor 'any' must return a value or consist of a single 'throw' statement.
|
||||
}
|
||||
|
||||
|
||||
@@ -30,9 +30,9 @@
|
||||
|
||||
function f2(): F<X<T>, Y<Z<T>>> {
|
||||
~~~~~~~~~~~~~~~~
|
||||
!!! A function whose declared type is neither 'void' nor 'any' must return a value or consist of a single 'throw' statement.
|
||||
~~~~~~~~~~~~~~~~
|
||||
!!! Cannot find name 'F'.
|
||||
~~~~~~~~~~~~~~~~
|
||||
!!! A function whose declared type is neither 'void' nor 'any' must return a value or consist of a single 'throw' statement.
|
||||
}
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
~~~~
|
||||
!!! 'with' statements are not allowed in strict mode.
|
||||
~
|
||||
!!! All symbols within a 'with' block will be resolved to 'any'.
|
||||
~
|
||||
!!! Cannot find name 'a'.
|
||||
~
|
||||
!!! All symbols within a 'with' block will be resolved to 'any'.
|
||||
}
|
||||
@@ -3,7 +3,7 @@
|
||||
~~~~
|
||||
!!! Statements are not allowed in ambient contexts.
|
||||
~~~
|
||||
!!! All symbols within a 'with' block will be resolved to 'any'.
|
||||
~~~
|
||||
!!! Cannot find name 'foo'.
|
||||
~~~
|
||||
!!! All symbols within a 'with' block will be resolved to 'any'.
|
||||
}
|
||||
@@ -51,18 +51,18 @@
|
||||
|
||||
interface D extends B, C {
|
||||
~
|
||||
!!! Numeric index type 'string' is not assignable to string index type 'number'.
|
||||
~
|
||||
!!! Property '4' of type 'boolean' is not assignable to string index type 'number'.
|
||||
~
|
||||
!!! Property '5' of type 'string' is not assignable to string index type 'number'.
|
||||
~
|
||||
!!! Property '6' of type '() => string' is not assignable to string index type 'number'.
|
||||
~
|
||||
!!! Numeric index type 'string' is not assignable to string index type 'number'.
|
||||
2: Z;
|
||||
~~~~~
|
||||
!!! Property '2' of type 'Z' is not assignable to numeric index type 'string'.
|
||||
~~~~~
|
||||
!!! Property '2' of type 'Z' is not assignable to string index type 'number'.
|
||||
~~~~~
|
||||
!!! Property '2' of type 'Z' is not assignable to numeric index type 'string'.
|
||||
Infinity: number;
|
||||
~~~~~~~~~~~~~~~~~
|
||||
!!! Property 'Infinity' of type 'number' is not assignable to numeric index type 'string'.
|
||||
|
||||
@@ -35,14 +35,14 @@
|
||||
~~~~~~~~~~~
|
||||
!!! Constraint of a type parameter cannot reference any type parameter from the same type parameter list.
|
||||
~
|
||||
!!! A function whose declared type is neither 'void' nor 'any' must return a value or consist of a single 'throw' statement.
|
||||
~
|
||||
!!! Cannot find name 'V'.
|
||||
~
|
||||
!!! A function whose declared type is neither 'void' nor 'any' must return a value or consist of a single 'throw' statement.
|
||||
function bar<V extends T, W extends U>(): X { // error
|
||||
~
|
||||
!!! A function whose declared type is neither 'void' nor 'any' must return a value or consist of a single 'throw' statement.
|
||||
~
|
||||
!!! Cannot find name 'X'.
|
||||
~
|
||||
!!! A function whose declared type is neither 'void' nor 'any' must return a value or consist of a single 'throw' statement.
|
||||
function baz<X extends W, Y extends V>(a: X, b: Y): T {
|
||||
x = y;
|
||||
~
|
||||
@@ -58,14 +58,14 @@
|
||||
~~~~~~~~~~~
|
||||
!!! Constraint of a type parameter cannot reference any type parameter from the same type parameter list.
|
||||
~
|
||||
!!! A function whose declared type is neither 'void' nor 'any' must return a value or consist of a single 'throw' statement.
|
||||
~
|
||||
!!! Cannot find name 'W'.
|
||||
~
|
||||
!!! A function whose declared type is neither 'void' nor 'any' must return a value or consist of a single 'throw' statement.
|
||||
function bar<V extends T, W extends U>(): Y { // error
|
||||
~
|
||||
!!! A function whose declared type is neither 'void' nor 'any' must return a value or consist of a single 'throw' statement.
|
||||
~
|
||||
!!! Cannot find name 'Y'.
|
||||
~
|
||||
!!! A function whose declared type is neither 'void' nor 'any' must return a value or consist of a single 'throw' statement.
|
||||
function baz<X extends W, Y extends V>(a: X, b: Y): T {
|
||||
x = y;
|
||||
~
|
||||
|
||||
@@ -10,9 +10,9 @@
|
||||
~~~~
|
||||
!!! Cannot find name 'asdf'.
|
||||
~~~~
|
||||
!!! A function whose declared type is neither 'void' nor 'any' must return a value or consist of a single 'throw' statement.
|
||||
~~~~
|
||||
!!! Cannot find name 'asdf'.
|
||||
~~~~
|
||||
!!! A function whose declared type is neither 'void' nor 'any' must return a value or consist of a single 'throw' statement.
|
||||
function foo2() {
|
||||
return asdf;
|
||||
~~~~
|
||||
|
||||
Reference in New Issue
Block a user