Updated check and emit, updated baselines
This commit is contained in:
parent
5b988cdbe4
commit
8dd9b9f2cb
|
@ -102,11 +102,9 @@ module ts {
|
|||
let anyArrayType: Type;
|
||||
let globalTypedPropertyDescriptorType: ObjectType;
|
||||
let globalClassDecoratorType: ObjectType;
|
||||
let globalClassDecoratorErasedType: ObjectType;
|
||||
let globalParameterDecoratorType: ObjectType;
|
||||
let globalPropertyDecoratorType: ObjectType;
|
||||
let globalPropertyDecoratorErasedType: ObjectType;
|
||||
|
||||
|
||||
let tupleTypes: Map<TupleType> = {};
|
||||
let unionTypes: Map<UnionType> = {};
|
||||
let stringLiteralTypes: Map<StringLiteralType> = {};
|
||||
|
@ -11344,9 +11342,7 @@ module ts {
|
|||
globalRegExpType = getGlobalType("RegExp");
|
||||
globalTypedPropertyDescriptorType = getTypeOfGlobalSymbol(getGlobalTypeSymbol("TypedPropertyDescriptor"), 1);
|
||||
globalClassDecoratorType = getGlobalType("ClassDecorator");
|
||||
globalClassDecoratorErasedType = instantiateSingleCallFunctionType(globalClassDecoratorType, [globalFunctionType]);
|
||||
globalPropertyDecoratorType = getGlobalType("PropertyDecorator");
|
||||
globalPropertyDecoratorErasedType = instantiateSingleCallFunctionType(globalPropertyDecoratorType, [anyType]);
|
||||
globalParameterDecoratorType = getGlobalType("ParameterDecorator");
|
||||
|
||||
// If we're in ES6 mode, load the TemplateStringsArray.
|
||||
|
|
|
@ -6053,7 +6053,6 @@ module ts {
|
|||
var __decorate = this.__decorate || function (decorators, target, key) {
|
||||
var kind = key == null ? 0 : typeof key == "number" ? 1 : 2, result = target;
|
||||
if (kind == 2) result = Object.getOwnPropertyDescriptor(target, typeof key == "symbol" ? key : key = String(key));
|
||||
if (kind == 2 && !result) kind = 1;
|
||||
for (var i = decorators.length - 1; i >= 0; --i) {
|
||||
var decorator = decorators[i];
|
||||
result = (kind == 0 ? decorator(result) : kind == 1 ? decorator(target, key) : decorator(target, key, result)) || result;
|
||||
|
|
|
@ -960,7 +960,6 @@ declare module "typescript" {
|
|||
getConstantValue(node: EnumMember | PropertyAccessExpression | ElementAccessExpression): number;
|
||||
isUnknownIdentifier(location: Node, name: string): boolean;
|
||||
getBlockScopedVariableId(node: Identifier): number;
|
||||
getClassDeclarationVariableId(node: Identifier): number;
|
||||
}
|
||||
const enum SymbolFlags {
|
||||
FunctionScopedVariable = 1,
|
||||
|
@ -1455,7 +1454,6 @@ declare module "typescript" {
|
|||
character: number;
|
||||
};
|
||||
function getLineAndCharacterOfPosition(sourceFile: SourceFile, position: number): LineAndCharacter;
|
||||
function lineBreakBetween(sourceFile: SourceFile, firstPos: number, secondPos: number): boolean;
|
||||
function isWhiteSpace(ch: number): boolean;
|
||||
function isLineBreak(ch: number): boolean;
|
||||
function isOctalDigit(ch: number): boolean;
|
||||
|
|
|
@ -3121,11 +3121,6 @@ declare module "typescript" {
|
|||
getBlockScopedVariableId(node: Identifier): number;
|
||||
>getBlockScopedVariableId : (node: Identifier) => number
|
||||
>node : Identifier
|
||||
>Identifier : Identifier
|
||||
|
||||
getClassDeclarationVariableId(node: Identifier): number;
|
||||
>getClassDeclarationVariableId : (node: Identifier) => number
|
||||
>node : Identifier
|
||||
>Identifier : Identifier
|
||||
}
|
||||
const enum SymbolFlags {
|
||||
|
@ -4614,13 +4609,6 @@ declare module "typescript" {
|
|||
>position : number
|
||||
>LineAndCharacter : LineAndCharacter
|
||||
|
||||
function lineBreakBetween(sourceFile: SourceFile, firstPos: number, secondPos: number): boolean;
|
||||
>lineBreakBetween : (sourceFile: SourceFile, firstPos: number, secondPos: number) => boolean
|
||||
>sourceFile : SourceFile
|
||||
>SourceFile : SourceFile
|
||||
>firstPos : number
|
||||
>secondPos : number
|
||||
|
||||
function isWhiteSpace(ch: number): boolean;
|
||||
>isWhiteSpace : (ch: number) => boolean
|
||||
>ch : number
|
||||
|
|
|
@ -991,7 +991,6 @@ declare module "typescript" {
|
|||
getConstantValue(node: EnumMember | PropertyAccessExpression | ElementAccessExpression): number;
|
||||
isUnknownIdentifier(location: Node, name: string): boolean;
|
||||
getBlockScopedVariableId(node: Identifier): number;
|
||||
getClassDeclarationVariableId(node: Identifier): number;
|
||||
}
|
||||
const enum SymbolFlags {
|
||||
FunctionScopedVariable = 1,
|
||||
|
@ -1486,7 +1485,6 @@ declare module "typescript" {
|
|||
character: number;
|
||||
};
|
||||
function getLineAndCharacterOfPosition(sourceFile: SourceFile, position: number): LineAndCharacter;
|
||||
function lineBreakBetween(sourceFile: SourceFile, firstPos: number, secondPos: number): boolean;
|
||||
function isWhiteSpace(ch: number): boolean;
|
||||
function isLineBreak(ch: number): boolean;
|
||||
function isOctalDigit(ch: number): boolean;
|
||||
|
|
|
@ -3267,11 +3267,6 @@ declare module "typescript" {
|
|||
getBlockScopedVariableId(node: Identifier): number;
|
||||
>getBlockScopedVariableId : (node: Identifier) => number
|
||||
>node : Identifier
|
||||
>Identifier : Identifier
|
||||
|
||||
getClassDeclarationVariableId(node: Identifier): number;
|
||||
>getClassDeclarationVariableId : (node: Identifier) => number
|
||||
>node : Identifier
|
||||
>Identifier : Identifier
|
||||
}
|
||||
const enum SymbolFlags {
|
||||
|
@ -4760,13 +4755,6 @@ declare module "typescript" {
|
|||
>position : number
|
||||
>LineAndCharacter : LineAndCharacter
|
||||
|
||||
function lineBreakBetween(sourceFile: SourceFile, firstPos: number, secondPos: number): boolean;
|
||||
>lineBreakBetween : (sourceFile: SourceFile, firstPos: number, secondPos: number) => boolean
|
||||
>sourceFile : SourceFile
|
||||
>SourceFile : SourceFile
|
||||
>firstPos : number
|
||||
>secondPos : number
|
||||
|
||||
function isWhiteSpace(ch: number): boolean;
|
||||
>isWhiteSpace : (ch: number) => boolean
|
||||
>ch : number
|
||||
|
|
|
@ -992,7 +992,6 @@ declare module "typescript" {
|
|||
getConstantValue(node: EnumMember | PropertyAccessExpression | ElementAccessExpression): number;
|
||||
isUnknownIdentifier(location: Node, name: string): boolean;
|
||||
getBlockScopedVariableId(node: Identifier): number;
|
||||
getClassDeclarationVariableId(node: Identifier): number;
|
||||
}
|
||||
const enum SymbolFlags {
|
||||
FunctionScopedVariable = 1,
|
||||
|
@ -1487,7 +1486,6 @@ declare module "typescript" {
|
|||
character: number;
|
||||
};
|
||||
function getLineAndCharacterOfPosition(sourceFile: SourceFile, position: number): LineAndCharacter;
|
||||
function lineBreakBetween(sourceFile: SourceFile, firstPos: number, secondPos: number): boolean;
|
||||
function isWhiteSpace(ch: number): boolean;
|
||||
function isLineBreak(ch: number): boolean;
|
||||
function isOctalDigit(ch: number): boolean;
|
||||
|
|
|
@ -3217,11 +3217,6 @@ declare module "typescript" {
|
|||
getBlockScopedVariableId(node: Identifier): number;
|
||||
>getBlockScopedVariableId : (node: Identifier) => number
|
||||
>node : Identifier
|
||||
>Identifier : Identifier
|
||||
|
||||
getClassDeclarationVariableId(node: Identifier): number;
|
||||
>getClassDeclarationVariableId : (node: Identifier) => number
|
||||
>node : Identifier
|
||||
>Identifier : Identifier
|
||||
}
|
||||
const enum SymbolFlags {
|
||||
|
@ -4710,13 +4705,6 @@ declare module "typescript" {
|
|||
>position : number
|
||||
>LineAndCharacter : LineAndCharacter
|
||||
|
||||
function lineBreakBetween(sourceFile: SourceFile, firstPos: number, secondPos: number): boolean;
|
||||
>lineBreakBetween : (sourceFile: SourceFile, firstPos: number, secondPos: number) => boolean
|
||||
>sourceFile : SourceFile
|
||||
>SourceFile : SourceFile
|
||||
>firstPos : number
|
||||
>secondPos : number
|
||||
|
||||
function isWhiteSpace(ch: number): boolean;
|
||||
>isWhiteSpace : (ch: number) => boolean
|
||||
>ch : number
|
||||
|
|
|
@ -1029,7 +1029,6 @@ declare module "typescript" {
|
|||
getConstantValue(node: EnumMember | PropertyAccessExpression | ElementAccessExpression): number;
|
||||
isUnknownIdentifier(location: Node, name: string): boolean;
|
||||
getBlockScopedVariableId(node: Identifier): number;
|
||||
getClassDeclarationVariableId(node: Identifier): number;
|
||||
}
|
||||
const enum SymbolFlags {
|
||||
FunctionScopedVariable = 1,
|
||||
|
@ -1524,7 +1523,6 @@ declare module "typescript" {
|
|||
character: number;
|
||||
};
|
||||
function getLineAndCharacterOfPosition(sourceFile: SourceFile, position: number): LineAndCharacter;
|
||||
function lineBreakBetween(sourceFile: SourceFile, firstPos: number, secondPos: number): boolean;
|
||||
function isWhiteSpace(ch: number): boolean;
|
||||
function isLineBreak(ch: number): boolean;
|
||||
function isOctalDigit(ch: number): boolean;
|
||||
|
|
|
@ -3390,11 +3390,6 @@ declare module "typescript" {
|
|||
getBlockScopedVariableId(node: Identifier): number;
|
||||
>getBlockScopedVariableId : (node: Identifier) => number
|
||||
>node : Identifier
|
||||
>Identifier : Identifier
|
||||
|
||||
getClassDeclarationVariableId(node: Identifier): number;
|
||||
>getClassDeclarationVariableId : (node: Identifier) => number
|
||||
>node : Identifier
|
||||
>Identifier : Identifier
|
||||
}
|
||||
const enum SymbolFlags {
|
||||
|
@ -4883,13 +4878,6 @@ declare module "typescript" {
|
|||
>position : number
|
||||
>LineAndCharacter : LineAndCharacter
|
||||
|
||||
function lineBreakBetween(sourceFile: SourceFile, firstPos: number, secondPos: number): boolean;
|
||||
>lineBreakBetween : (sourceFile: SourceFile, firstPos: number, secondPos: number) => boolean
|
||||
>sourceFile : SourceFile
|
||||
>SourceFile : SourceFile
|
||||
>firstPos : number
|
||||
>secondPos : number
|
||||
|
||||
function isWhiteSpace(ch: number): boolean;
|
||||
>isWhiteSpace : (ch: number) => boolean
|
||||
>ch : number
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
tests/cases/conformance/decorators/class/decoratorOnClass8.ts(3,1): error TS2322: Type '(target: Function, paramIndex: number) => void' is not assignable to type '(target: Function) => void | Function'.
|
||||
tests/cases/conformance/decorators/class/decoratorOnClass8.ts(3,1): error TS2322: Type '(target: Function, paramIndex: number) => void' is not assignable to type '(target: typeof C) => void | typeof C'.
|
||||
|
||||
|
||||
==== tests/cases/conformance/decorators/class/decoratorOnClass8.ts (1 errors) ====
|
||||
|
@ -6,6 +6,6 @@ tests/cases/conformance/decorators/class/decoratorOnClass8.ts(3,1): error TS2322
|
|||
|
||||
@dec()
|
||||
~~~~~~
|
||||
!!! error TS2322: Type '(target: Function, paramIndex: number) => void' is not assignable to type '(target: Function) => void | Function'.
|
||||
!!! error TS2322: Type '(target: Function, paramIndex: number) => void' is not assignable to type '(target: typeof C) => void | typeof C'.
|
||||
class C {
|
||||
}
|
|
@ -1,4 +1,4 @@
|
|||
tests/cases/conformance/decorators/class/method/decoratorOnClassMethod10.ts(4,5): error TS2322: Type '(target: Function, paramIndex: number) => void' is not assignable to type '(target: Object, propertyKey: string | symbol, descriptor: TypedPropertyDescriptor<any>) => void | TypedPropertyDescriptor<any>'.
|
||||
tests/cases/conformance/decorators/class/method/decoratorOnClassMethod10.ts(4,5): error TS2322: Type '(target: Function, paramIndex: number) => void' is not assignable to type '(target: Object, propertyKey: string | symbol, descriptor: TypedPropertyDescriptor<() => void>) => void | TypedPropertyDescriptor<() => void>'.
|
||||
Types of parameters 'paramIndex' and 'propertyKey' are incompatible.
|
||||
Type 'number' is not assignable to type 'string | symbol'.
|
||||
Type 'number' is not assignable to type 'symbol'.
|
||||
|
@ -10,7 +10,7 @@ tests/cases/conformance/decorators/class/method/decoratorOnClassMethod10.ts(4,5)
|
|||
class C {
|
||||
@dec method() {}
|
||||
~~~~
|
||||
!!! error TS2322: Type '(target: Function, paramIndex: number) => void' is not assignable to type '(target: Object, propertyKey: string | symbol, descriptor: TypedPropertyDescriptor<any>) => void | TypedPropertyDescriptor<any>'.
|
||||
!!! error TS2322: Type '(target: Function, paramIndex: number) => void' is not assignable to type '(target: Object, propertyKey: string | symbol, descriptor: TypedPropertyDescriptor<() => void>) => void | TypedPropertyDescriptor<() => void>'.
|
||||
!!! error TS2322: Types of parameters 'paramIndex' and 'propertyKey' are incompatible.
|
||||
!!! error TS2322: Type 'number' is not assignable to type 'string | symbol'.
|
||||
!!! error TS2322: Type 'number' is not assignable to type 'symbol'.
|
||||
|
|
|
@ -1,27 +1,27 @@
|
|||
//// [decoratorOnClassMethod4.ts]
|
||||
//// [decoratorOnClassMethod4.ts]
|
||||
declare function dec<T>(target: any, propertyKey: string, descriptor: TypedPropertyDescriptor<T>): TypedPropertyDescriptor<T>;
|
||||
|
||||
class C {
|
||||
@dec ["method"]() {}
|
||||
}
|
||||
|
||||
//// [decoratorOnClassMethod4.js]
|
||||
var __decorate = this.__decorate || function (decorators, target, key) {
|
||||
var kind = key == null ? 0 : typeof key == "number" ? 1 : 2, result = target;
|
||||
if (kind == 2) result = Object.getOwnPropertyDescriptor(target, typeof key == "symbol" ? key : key = String(key));
|
||||
for (var i = decorators.length - 1; i >= 0; --i) {
|
||||
var decorator = decorators[i];
|
||||
result = (kind == 0 ? decorator(result) : kind == 1 ? decorator(target, key) : decorator(target, key, result)) || result;
|
||||
}
|
||||
if (kind == 2 && result) Object.defineProperty(target, key, result);
|
||||
if (kind == 0) return result;
|
||||
};
|
||||
var C = (function() {
|
||||
class C {
|
||||
[_a = "method"]() {
|
||||
}
|
||||
}
|
||||
__decorate([dec], C.prototype, _a);
|
||||
return C;
|
||||
var _a;
|
||||
})();
|
||||
}
|
||||
|
||||
//// [decoratorOnClassMethod4.js]
|
||||
var __decorate = this.__decorate || function (decorators, target, key) {
|
||||
var kind = key == null ? 0 : typeof key == "number" ? 1 : 2, result = target;
|
||||
if (kind == 2) result = Object.getOwnPropertyDescriptor(target, typeof key == "symbol" ? key : key = String(key));
|
||||
for (var i = decorators.length - 1; i >= 0; --i) {
|
||||
var decorator = decorators[i];
|
||||
result = (kind == 0 ? decorator(result) : kind == 1 ? decorator(target, key) : decorator(target, key, result)) || result;
|
||||
}
|
||||
if (kind == 2 && result) Object.defineProperty(target, key, result);
|
||||
if (kind == 0) return result;
|
||||
};
|
||||
let C = () => {
|
||||
class C {
|
||||
[_a = "method"]() {
|
||||
}
|
||||
}
|
||||
__decorate([dec], C.prototype, _a);
|
||||
return C;
|
||||
var _a;
|
||||
}();
|
||||
|
|
|
@ -1,27 +1,27 @@
|
|||
//// [decoratorOnClassMethod5.ts]
|
||||
//// [decoratorOnClassMethod5.ts]
|
||||
declare function dec(): <T>(target: any, propertyKey: string, descriptor: TypedPropertyDescriptor<T>) => TypedPropertyDescriptor<T>;
|
||||
|
||||
class C {
|
||||
@dec() ["method"]() {}
|
||||
}
|
||||
|
||||
//// [decoratorOnClassMethod5.js]
|
||||
var __decorate = this.__decorate || function (decorators, target, key) {
|
||||
var kind = key == null ? 0 : typeof key == "number" ? 1 : 2, result = target;
|
||||
if (kind == 2) result = Object.getOwnPropertyDescriptor(target, typeof key == "symbol" ? key : key = String(key));
|
||||
for (var i = decorators.length - 1; i >= 0; --i) {
|
||||
var decorator = decorators[i];
|
||||
result = (kind == 0 ? decorator(result) : kind == 1 ? decorator(target, key) : decorator(target, key, result)) || result;
|
||||
}
|
||||
if (kind == 2 && result) Object.defineProperty(target, key, result);
|
||||
if (kind == 0) return result;
|
||||
};
|
||||
var C = (function() {
|
||||
class C {
|
||||
[_a = "method"]() {
|
||||
}
|
||||
}
|
||||
__decorate([dec()], C.prototype, _a);
|
||||
return C;
|
||||
var _a;
|
||||
})();
|
||||
}
|
||||
|
||||
//// [decoratorOnClassMethod5.js]
|
||||
var __decorate = this.__decorate || function (decorators, target, key) {
|
||||
var kind = key == null ? 0 : typeof key == "number" ? 1 : 2, result = target;
|
||||
if (kind == 2) result = Object.getOwnPropertyDescriptor(target, typeof key == "symbol" ? key : key = String(key));
|
||||
for (var i = decorators.length - 1; i >= 0; --i) {
|
||||
var decorator = decorators[i];
|
||||
result = (kind == 0 ? decorator(result) : kind == 1 ? decorator(target, key) : decorator(target, key, result)) || result;
|
||||
}
|
||||
if (kind == 2 && result) Object.defineProperty(target, key, result);
|
||||
if (kind == 0) return result;
|
||||
};
|
||||
let C = () => {
|
||||
class C {
|
||||
[_a = "method"]() {
|
||||
}
|
||||
}
|
||||
__decorate([dec()], C.prototype, _a);
|
||||
return C;
|
||||
var _a;
|
||||
}();
|
||||
|
|
|
@ -1,27 +1,27 @@
|
|||
//// [decoratorOnClassMethod6.ts]
|
||||
//// [decoratorOnClassMethod6.ts]
|
||||
declare function dec(): <T>(target: any, propertyKey: string, descriptor: TypedPropertyDescriptor<T>) => TypedPropertyDescriptor<T>;
|
||||
|
||||
class C {
|
||||
@dec ["method"]() {}
|
||||
}
|
||||
|
||||
//// [decoratorOnClassMethod6.js]
|
||||
var __decorate = this.__decorate || function (decorators, target, key) {
|
||||
var kind = key == null ? 0 : typeof key == "number" ? 1 : 2, result = target;
|
||||
if (kind == 2) result = Object.getOwnPropertyDescriptor(target, typeof key == "symbol" ? key : key = String(key));
|
||||
for (var i = decorators.length - 1; i >= 0; --i) {
|
||||
var decorator = decorators[i];
|
||||
result = (kind == 0 ? decorator(result) : kind == 1 ? decorator(target, key) : decorator(target, key, result)) || result;
|
||||
}
|
||||
if (kind == 2 && result) Object.defineProperty(target, key, result);
|
||||
if (kind == 0) return result;
|
||||
};
|
||||
var C = (function() {
|
||||
class C {
|
||||
[_a = "method"]() {
|
||||
}
|
||||
}
|
||||
__decorate([dec], C.prototype, _a);
|
||||
return C;
|
||||
var _a;
|
||||
})();
|
||||
}
|
||||
|
||||
//// [decoratorOnClassMethod6.js]
|
||||
var __decorate = this.__decorate || function (decorators, target, key) {
|
||||
var kind = key == null ? 0 : typeof key == "number" ? 1 : 2, result = target;
|
||||
if (kind == 2) result = Object.getOwnPropertyDescriptor(target, typeof key == "symbol" ? key : key = String(key));
|
||||
for (var i = decorators.length - 1; i >= 0; --i) {
|
||||
var decorator = decorators[i];
|
||||
result = (kind == 0 ? decorator(result) : kind == 1 ? decorator(target, key) : decorator(target, key, result)) || result;
|
||||
}
|
||||
if (kind == 2 && result) Object.defineProperty(target, key, result);
|
||||
if (kind == 0) return result;
|
||||
};
|
||||
let C = () => {
|
||||
class C {
|
||||
[_a = "method"]() {
|
||||
}
|
||||
}
|
||||
__decorate([dec], C.prototype, _a);
|
||||
return C;
|
||||
var _a;
|
||||
}();
|
||||
|
|
|
@ -1,27 +1,27 @@
|
|||
//// [decoratorOnClassMethod7.ts]
|
||||
//// [decoratorOnClassMethod7.ts]
|
||||
declare function dec<T>(target: any, propertyKey: string, descriptor: TypedPropertyDescriptor<T>): TypedPropertyDescriptor<T>;
|
||||
|
||||
class C {
|
||||
@dec public ["method"]() {}
|
||||
}
|
||||
|
||||
//// [decoratorOnClassMethod7.js]
|
||||
var __decorate = this.__decorate || function (decorators, target, key) {
|
||||
var kind = key == null ? 0 : typeof key == "number" ? 1 : 2, result = target;
|
||||
if (kind == 2) result = Object.getOwnPropertyDescriptor(target, typeof key == "symbol" ? key : key = String(key));
|
||||
for (var i = decorators.length - 1; i >= 0; --i) {
|
||||
var decorator = decorators[i];
|
||||
result = (kind == 0 ? decorator(result) : kind == 1 ? decorator(target, key) : decorator(target, key, result)) || result;
|
||||
}
|
||||
if (kind == 2 && result) Object.defineProperty(target, key, result);
|
||||
if (kind == 0) return result;
|
||||
};
|
||||
var C = (function() {
|
||||
class C {
|
||||
[_a = "method"]() {
|
||||
}
|
||||
}
|
||||
__decorate([dec], C.prototype, _a);
|
||||
return C;
|
||||
var _a;
|
||||
})();
|
||||
}
|
||||
|
||||
//// [decoratorOnClassMethod7.js]
|
||||
var __decorate = this.__decorate || function (decorators, target, key) {
|
||||
var kind = key == null ? 0 : typeof key == "number" ? 1 : 2, result = target;
|
||||
if (kind == 2) result = Object.getOwnPropertyDescriptor(target, typeof key == "symbol" ? key : key = String(key));
|
||||
for (var i = decorators.length - 1; i >= 0; --i) {
|
||||
var decorator = decorators[i];
|
||||
result = (kind == 0 ? decorator(result) : kind == 1 ? decorator(target, key) : decorator(target, key, result)) || result;
|
||||
}
|
||||
if (kind == 2 && result) Object.defineProperty(target, key, result);
|
||||
if (kind == 0) return result;
|
||||
};
|
||||
let C = () => {
|
||||
class C {
|
||||
[_a = "method"]() {
|
||||
}
|
||||
}
|
||||
__decorate([dec], C.prototype, _a);
|
||||
return C;
|
||||
var _a;
|
||||
}();
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
tests/cases/conformance/decorators/class/property/decoratorOnClassProperty13.ts(4,5): error TS1208: A decorator may not change the type of a member.
|
||||
tests/cases/conformance/decorators/class/property/decoratorOnClassProperty13.ts(4,5): error TS2322: Type '<T>(target: any, propertyKey: string, descriptor: TypedPropertyDescriptor<T>) => TypedPropertyDescriptor<number>' is not assignable to type '(target: Object, propertyKey: string | symbol, descriptor: TypedPropertyDescriptor<string>) => void | TypedPropertyDescriptor<string>'.
|
||||
Type 'TypedPropertyDescriptor<number>' is not assignable to type 'void | TypedPropertyDescriptor<string>'.
|
||||
Type 'TypedPropertyDescriptor<number>' is not assignable to type 'TypedPropertyDescriptor<string>'.
|
||||
Type 'number' is not assignable to type 'string'.
|
||||
|
@ -10,8 +10,8 @@ tests/cases/conformance/decorators/class/property/decoratorOnClassProperty13.ts(
|
|||
class C {
|
||||
@dec prop: string;
|
||||
~~~~
|
||||
!!! error TS1208: A decorator may not change the type of a member.
|
||||
!!! error TS1208: Type 'TypedPropertyDescriptor<number>' is not assignable to type 'void | TypedPropertyDescriptor<string>'.
|
||||
!!! error TS1208: Type 'TypedPropertyDescriptor<number>' is not assignable to type 'TypedPropertyDescriptor<string>'.
|
||||
!!! error TS1208: Type 'number' is not assignable to type 'string'.
|
||||
!!! error TS2322: Type '<T>(target: any, propertyKey: string, descriptor: TypedPropertyDescriptor<T>) => TypedPropertyDescriptor<number>' is not assignable to type '(target: Object, propertyKey: string | symbol, descriptor: TypedPropertyDescriptor<string>) => void | TypedPropertyDescriptor<string>'.
|
||||
!!! error TS2322: Type 'TypedPropertyDescriptor<number>' is not assignable to type 'void | TypedPropertyDescriptor<string>'.
|
||||
!!! error TS2322: Type 'TypedPropertyDescriptor<number>' is not assignable to type 'TypedPropertyDescriptor<string>'.
|
||||
!!! error TS2322: Type 'number' is not assignable to type 'string'.
|
||||
}
|
|
@ -6,7 +6,7 @@ export default class {
|
|||
|
||||
|
||||
//// [es6ExportDefaultClassDeclaration2.js]
|
||||
export default class {
|
||||
export default class {
|
||||
method() {
|
||||
}
|
||||
}
|
||||
|
|
|
@ -94,10 +94,10 @@ var Greeter = (function () {
|
|||
Greeter.x1 = 10;
|
||||
__decorate([PropertyDecorator1, PropertyDecorator2(40)], Greeter.prototype, "greet");
|
||||
__decorate([PropertyDecorator1, PropertyDecorator2(50)], Greeter.prototype, "x");
|
||||
__decorate([PropertyDecorator1, PropertyDecorator2(60)], Greeter, "x1");
|
||||
__decorate([ParameterDecorator1, ParameterDecorator2(70)], Greeter.prototype.fn, 0);
|
||||
__decorate([ParameterDecorator1, ParameterDecorator2(90)], _set_greetings, 0);
|
||||
__decorate([PropertyDecorator1, PropertyDecorator2(80), PropertyDecorator1, PropertyDecorator2(90)], Greeter.prototype, "greetings");
|
||||
__decorate([PropertyDecorator1, PropertyDecorator2(60)], Greeter, "x1");
|
||||
__decorate([ParameterDecorator1, ParameterDecorator2(20)], Greeter, 0);
|
||||
__decorate([ParameterDecorator1, ParameterDecorator2(30)], Greeter, 1);
|
||||
Greeter = __decorate([ClassDecorator1, ClassDecorator2(10)], Greeter);
|
||||
|
|
|
@ -1,2 +1,2 @@
|
|||
//// [sourceMapValidationDecorators.js.map]
|
||||
{"version":3,"file":"sourceMapValidationDecorators.js","sourceRoot":"","sources":["sourceMapValidationDecorators.ts"],"names":["Greeter","Greeter.constructor","Greeter.greet","Greeter.fn","Greeter.greetings"],"mappings":";;;;;;;;;;AAOA;IAGIA,iBAGSA,QAAgBA;QAEvBC,WAEcA;aAFdA,WAEcA,CAFdA,sBAEcA,CAFdA,IAEcA;YAFdA,0BAEcA;;QAJPA,aAAQA,GAARA,QAAQA,CAAQA;IAKzBA,CAACA;IAIDD,uBAAKA,GAFLA;QAGIE,MAAMA,CAACA,MAAMA,GAAGA,IAAIA,CAACA,QAAQA,GAAGA,OAAOA,CAACA;IAC5CA,CAACA;IAUOF,oBAAEA,GAAVA,UAGEA,CAASA;QACPG,MAAMA,CAACA,IAAIA,CAACA,QAAQA,CAACA;IACzBA,CAACA;IAEDH,sBAEIA,8BAASA;aAFbA;YAGII,MAAMA,CAACA,IAAIA,CAACA,QAAQA,CAACA;QACzBA,CAACA;aAEDJ,2BAKEA,SAAiBA;YACfI,IAAIA,CAACA,QAAQA,GAAGA,SAASA,CAACA;QAC9BA,CAACA;;;OATAJ;IAbcA,UAAEA,GAAWA,EAAEA,CAACA;IAZ/BA,YAACA,kBAAkBA,EAClBA,kBAAkBA,CAACA,EAAEA,CAACA,+BAGtBA;IAEDA,YAACA,kBAAkBA,EAClBA,kBAAkBA,CAACA,EAAEA,CAACA,2BACLA;IAElBA,YAACA,kBAAkBA,EAClBA,kBAAkBA,CAACA,EAAEA,CAACA,kBACQA;IAE/BA,YACGA,mBAAmBA,EACnBA,mBAAmBA,CAACA,EAAEA,CAACA,4BAGzBA;IAQDA,YAGGA,mBAAmBA,EACnBA,mBAAmBA,CAACA,EAAEA,CAACA,sBAGzBA;IAbDA,YAACA,kBAAkBA,EAClBA,kBAAkBA,CAACA,EAAEA,CAACA,EAKtBA,kBAAkBA,EAClBA,kBAAkBA,CAACA,EAAEA,CAACA,mCAHtBA;IAnCDA,YACGA,mBAAmBA,EACnBA,mBAAmBA,CAACA,EAAEA,CAACA,eAMzBA;IARDA,YAKGA,mBAAmBA,EACnBA,mBAAmBA,CAACA,EAAEA,CAACA,eAEzBA;IAXLA,sBAACA,eAAeA,EACfA,eAAeA,CAACA,EAAEA,CAACA,YA+CnBA;IAADA,cAACA;;AAADA,CAACA,AAhDD,IAgDC"}
|
||||
{"version":3,"file":"sourceMapValidationDecorators.js","sourceRoot":"","sources":["sourceMapValidationDecorators.ts"],"names":["Greeter","Greeter.constructor","Greeter.greet","Greeter.fn","Greeter.greetings"],"mappings":";;;;;;;;;;AAOA;IAGIA,iBAGSA,QAAgBA;QAEvBC,WAEcA;aAFdA,WAEcA,CAFdA,sBAEcA,CAFdA,IAEcA;YAFdA,0BAEcA;;QAJPA,aAAQA,GAARA,QAAQA,CAAQA;IAKzBA,CAACA;IAIDD,uBAAKA,GAFLA;QAGIE,MAAMA,CAACA,MAAMA,GAAGA,IAAIA,CAACA,QAAQA,GAAGA,OAAOA,CAACA;IAC5CA,CAACA;IAUOF,oBAAEA,GAAVA,UAGEA,CAASA;QACPG,MAAMA,CAACA,IAAIA,CAACA,QAAQA,CAACA;IACzBA,CAACA;IAEDH,sBAEIA,8BAASA;aAFbA;YAGII,MAAMA,CAACA,IAAIA,CAACA,QAAQA,CAACA;QACzBA,CAACA;aAEDJ,2BAKEA,SAAiBA;YACfI,IAAIA,CAACA,QAAQA,GAAGA,SAASA,CAACA;QAC9BA,CAACA;;;OATAJ;IAbcA,UAAEA,GAAWA,EAAEA,CAACA;IAZ/BA,YAACA,kBAAkBA,EAClBA,kBAAkBA,CAACA,EAAEA,CAACA,+BAGtBA;IAEDA,YAACA,kBAAkBA,EAClBA,kBAAkBA,CAACA,EAAEA,CAACA,2BACLA;IAMlBA,YACGA,mBAAmBA,EACnBA,mBAAmBA,CAACA,EAAEA,CAACA,4BAGzBA;IAQDA,YAGGA,mBAAmBA,EACnBA,mBAAmBA,CAACA,EAAEA,CAACA,sBAGzBA;IAbDA,YAACA,kBAAkBA,EAClBA,kBAAkBA,CAACA,EAAEA,CAACA,EAKtBA,kBAAkBA,EAClBA,kBAAkBA,CAACA,EAAEA,CAACA,mCAHtBA;IAfDA,YAACA,kBAAkBA,EAClBA,kBAAkBA,CAACA,EAAEA,CAACA,kBACQA;IAtB/BA,YACGA,mBAAmBA,EACnBA,mBAAmBA,CAACA,EAAEA,CAACA,eAMzBA;IARDA,YAKGA,mBAAmBA,EACnBA,mBAAmBA,CAACA,EAAEA,CAACA,eAEzBA;IAXLA,sBAACA,eAAeA,EACfA,eAAeA,CAACA,EAAEA,CAACA,YA+CnBA;IAADA,cAACA;;AAADA,CAACA,AAhDD,IAgDC"}
|
|
@ -435,6 +435,7 @@ sourceFile:sourceMapValidationDecorators.ts
|
|||
7 > ^^
|
||||
8 > ^
|
||||
9 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
10> ^^^^->
|
||||
1 >
|
||||
>
|
||||
>
|
||||
|
@ -458,40 +459,6 @@ sourceFile:sourceMapValidationDecorators.ts
|
|||
8 >Emitted(37, 59) Source(28, 28) + SourceIndex(0) name (Greeter)
|
||||
9 >Emitted(37, 86) Source(29, 23) + SourceIndex(0) name (Greeter)
|
||||
---
|
||||
>>> __decorate([PropertyDecorator1, PropertyDecorator2(60)], Greeter, "x1");
|
||||
1 >^^^^
|
||||
2 > ^^^^^^^^^^^^
|
||||
3 > ^^^^^^^^^^^^^^^^^^
|
||||
4 > ^^
|
||||
5 > ^^^^^^^^^^^^^^^^^^
|
||||
6 > ^
|
||||
7 > ^^
|
||||
8 > ^
|
||||
9 > ^^^^^^^^^^^^^^^^^^
|
||||
10> ^^^^^^^^^^^^^->
|
||||
1 >
|
||||
>
|
||||
>
|
||||
2 > @
|
||||
3 > PropertyDecorator1
|
||||
4 >
|
||||
> @
|
||||
5 > PropertyDecorator2
|
||||
6 > (
|
||||
7 > 60
|
||||
8 > )
|
||||
9 >
|
||||
> private static x1: number = 10;
|
||||
1 >Emitted(38, 5) Source(31, 5) + SourceIndex(0) name (Greeter)
|
||||
2 >Emitted(38, 17) Source(31, 6) + SourceIndex(0) name (Greeter)
|
||||
3 >Emitted(38, 35) Source(31, 24) + SourceIndex(0) name (Greeter)
|
||||
4 >Emitted(38, 37) Source(32, 6) + SourceIndex(0) name (Greeter)
|
||||
5 >Emitted(38, 55) Source(32, 24) + SourceIndex(0) name (Greeter)
|
||||
6 >Emitted(38, 56) Source(32, 25) + SourceIndex(0) name (Greeter)
|
||||
7 >Emitted(38, 58) Source(32, 27) + SourceIndex(0) name (Greeter)
|
||||
8 >Emitted(38, 59) Source(32, 28) + SourceIndex(0) name (Greeter)
|
||||
9 >Emitted(38, 77) Source(33, 36) + SourceIndex(0) name (Greeter)
|
||||
---
|
||||
>>> __decorate([ParameterDecorator1, ParameterDecorator2(70)], Greeter.prototype.fn, 0);
|
||||
1->^^^^
|
||||
2 > ^^^^^^^^^^^^
|
||||
|
@ -503,6 +470,10 @@ sourceFile:sourceMapValidationDecorators.ts
|
|||
8 > ^
|
||||
9 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
1->
|
||||
>
|
||||
> @PropertyDecorator1
|
||||
> @PropertyDecorator2(60)
|
||||
> private static x1: number = 10;
|
||||
>
|
||||
>
|
||||
2 > private fn(
|
||||
|
@ -518,15 +489,15 @@ sourceFile:sourceMapValidationDecorators.ts
|
|||
> x: number) {
|
||||
> return this.greeting;
|
||||
> }
|
||||
1->Emitted(39, 5) Source(35, 5) + SourceIndex(0) name (Greeter)
|
||||
2 >Emitted(39, 17) Source(36, 8) + SourceIndex(0) name (Greeter)
|
||||
3 >Emitted(39, 36) Source(36, 27) + SourceIndex(0) name (Greeter)
|
||||
4 >Emitted(39, 38) Source(37, 8) + SourceIndex(0) name (Greeter)
|
||||
5 >Emitted(39, 57) Source(37, 27) + SourceIndex(0) name (Greeter)
|
||||
6 >Emitted(39, 58) Source(37, 28) + SourceIndex(0) name (Greeter)
|
||||
7 >Emitted(39, 60) Source(37, 30) + SourceIndex(0) name (Greeter)
|
||||
8 >Emitted(39, 61) Source(37, 31) + SourceIndex(0) name (Greeter)
|
||||
9 >Emitted(39, 89) Source(40, 6) + SourceIndex(0) name (Greeter)
|
||||
1->Emitted(38, 5) Source(35, 5) + SourceIndex(0) name (Greeter)
|
||||
2 >Emitted(38, 17) Source(36, 8) + SourceIndex(0) name (Greeter)
|
||||
3 >Emitted(38, 36) Source(36, 27) + SourceIndex(0) name (Greeter)
|
||||
4 >Emitted(38, 38) Source(37, 8) + SourceIndex(0) name (Greeter)
|
||||
5 >Emitted(38, 57) Source(37, 27) + SourceIndex(0) name (Greeter)
|
||||
6 >Emitted(38, 58) Source(37, 28) + SourceIndex(0) name (Greeter)
|
||||
7 >Emitted(38, 60) Source(37, 30) + SourceIndex(0) name (Greeter)
|
||||
8 >Emitted(38, 61) Source(37, 31) + SourceIndex(0) name (Greeter)
|
||||
9 >Emitted(38, 89) Source(40, 6) + SourceIndex(0) name (Greeter)
|
||||
---
|
||||
>>> __decorate([ParameterDecorator1, ParameterDecorator2(90)], _set_greetings, 0);
|
||||
1 >^^^^
|
||||
|
@ -563,15 +534,15 @@ sourceFile:sourceMapValidationDecorators.ts
|
|||
> greetings: string) {
|
||||
> this.greeting = greetings;
|
||||
> }
|
||||
1 >Emitted(40, 5) Source(48, 5) + SourceIndex(0) name (Greeter)
|
||||
2 >Emitted(40, 17) Source(51, 8) + SourceIndex(0) name (Greeter)
|
||||
3 >Emitted(40, 36) Source(51, 27) + SourceIndex(0) name (Greeter)
|
||||
4 >Emitted(40, 38) Source(52, 8) + SourceIndex(0) name (Greeter)
|
||||
5 >Emitted(40, 57) Source(52, 27) + SourceIndex(0) name (Greeter)
|
||||
6 >Emitted(40, 58) Source(52, 28) + SourceIndex(0) name (Greeter)
|
||||
7 >Emitted(40, 60) Source(52, 30) + SourceIndex(0) name (Greeter)
|
||||
8 >Emitted(40, 61) Source(52, 31) + SourceIndex(0) name (Greeter)
|
||||
9 >Emitted(40, 83) Source(55, 6) + SourceIndex(0) name (Greeter)
|
||||
1 >Emitted(39, 5) Source(48, 5) + SourceIndex(0) name (Greeter)
|
||||
2 >Emitted(39, 17) Source(51, 8) + SourceIndex(0) name (Greeter)
|
||||
3 >Emitted(39, 36) Source(51, 27) + SourceIndex(0) name (Greeter)
|
||||
4 >Emitted(39, 38) Source(52, 8) + SourceIndex(0) name (Greeter)
|
||||
5 >Emitted(39, 57) Source(52, 27) + SourceIndex(0) name (Greeter)
|
||||
6 >Emitted(39, 58) Source(52, 28) + SourceIndex(0) name (Greeter)
|
||||
7 >Emitted(39, 60) Source(52, 30) + SourceIndex(0) name (Greeter)
|
||||
8 >Emitted(39, 61) Source(52, 31) + SourceIndex(0) name (Greeter)
|
||||
9 >Emitted(39, 83) Source(55, 6) + SourceIndex(0) name (Greeter)
|
||||
---
|
||||
>>> __decorate([PropertyDecorator1, PropertyDecorator2(80), PropertyDecorator1, PropertyDecorator2(90)], Greeter.prototype, "greetings");
|
||||
1->^^^^
|
||||
|
@ -613,22 +584,53 @@ sourceFile:sourceMapValidationDecorators.ts
|
|||
14> 90
|
||||
15> )
|
||||
16>
|
||||
1->Emitted(41, 5) Source(42, 5) + SourceIndex(0) name (Greeter)
|
||||
2 >Emitted(41, 17) Source(42, 6) + SourceIndex(0) name (Greeter)
|
||||
3 >Emitted(41, 35) Source(42, 24) + SourceIndex(0) name (Greeter)
|
||||
4 >Emitted(41, 37) Source(43, 6) + SourceIndex(0) name (Greeter)
|
||||
5 >Emitted(41, 55) Source(43, 24) + SourceIndex(0) name (Greeter)
|
||||
6 >Emitted(41, 56) Source(43, 25) + SourceIndex(0) name (Greeter)
|
||||
7 >Emitted(41, 58) Source(43, 27) + SourceIndex(0) name (Greeter)
|
||||
8 >Emitted(41, 59) Source(43, 28) + SourceIndex(0) name (Greeter)
|
||||
9 >Emitted(41, 61) Source(48, 6) + SourceIndex(0) name (Greeter)
|
||||
10>Emitted(41, 79) Source(48, 24) + SourceIndex(0) name (Greeter)
|
||||
11>Emitted(41, 81) Source(49, 6) + SourceIndex(0) name (Greeter)
|
||||
12>Emitted(41, 99) Source(49, 24) + SourceIndex(0) name (Greeter)
|
||||
13>Emitted(41, 100) Source(49, 25) + SourceIndex(0) name (Greeter)
|
||||
14>Emitted(41, 102) Source(49, 27) + SourceIndex(0) name (Greeter)
|
||||
15>Emitted(41, 103) Source(49, 28) + SourceIndex(0) name (Greeter)
|
||||
16>Emitted(41, 138) Source(46, 6) + SourceIndex(0) name (Greeter)
|
||||
1->Emitted(40, 5) Source(42, 5) + SourceIndex(0) name (Greeter)
|
||||
2 >Emitted(40, 17) Source(42, 6) + SourceIndex(0) name (Greeter)
|
||||
3 >Emitted(40, 35) Source(42, 24) + SourceIndex(0) name (Greeter)
|
||||
4 >Emitted(40, 37) Source(43, 6) + SourceIndex(0) name (Greeter)
|
||||
5 >Emitted(40, 55) Source(43, 24) + SourceIndex(0) name (Greeter)
|
||||
6 >Emitted(40, 56) Source(43, 25) + SourceIndex(0) name (Greeter)
|
||||
7 >Emitted(40, 58) Source(43, 27) + SourceIndex(0) name (Greeter)
|
||||
8 >Emitted(40, 59) Source(43, 28) + SourceIndex(0) name (Greeter)
|
||||
9 >Emitted(40, 61) Source(48, 6) + SourceIndex(0) name (Greeter)
|
||||
10>Emitted(40, 79) Source(48, 24) + SourceIndex(0) name (Greeter)
|
||||
11>Emitted(40, 81) Source(49, 6) + SourceIndex(0) name (Greeter)
|
||||
12>Emitted(40, 99) Source(49, 24) + SourceIndex(0) name (Greeter)
|
||||
13>Emitted(40, 100) Source(49, 25) + SourceIndex(0) name (Greeter)
|
||||
14>Emitted(40, 102) Source(49, 27) + SourceIndex(0) name (Greeter)
|
||||
15>Emitted(40, 103) Source(49, 28) + SourceIndex(0) name (Greeter)
|
||||
16>Emitted(40, 138) Source(46, 6) + SourceIndex(0) name (Greeter)
|
||||
---
|
||||
>>> __decorate([PropertyDecorator1, PropertyDecorator2(60)], Greeter, "x1");
|
||||
1 >^^^^
|
||||
2 > ^^^^^^^^^^^^
|
||||
3 > ^^^^^^^^^^^^^^^^^^
|
||||
4 > ^^
|
||||
5 > ^^^^^^^^^^^^^^^^^^
|
||||
6 > ^
|
||||
7 > ^^
|
||||
8 > ^
|
||||
9 > ^^^^^^^^^^^^^^^^^^
|
||||
1 >
|
||||
2 > @
|
||||
3 > PropertyDecorator1
|
||||
4 >
|
||||
> @
|
||||
5 > PropertyDecorator2
|
||||
6 > (
|
||||
7 > 60
|
||||
8 > )
|
||||
9 >
|
||||
> private static x1: number = 10;
|
||||
1 >Emitted(41, 5) Source(31, 5) + SourceIndex(0) name (Greeter)
|
||||
2 >Emitted(41, 17) Source(31, 6) + SourceIndex(0) name (Greeter)
|
||||
3 >Emitted(41, 35) Source(31, 24) + SourceIndex(0) name (Greeter)
|
||||
4 >Emitted(41, 37) Source(32, 6) + SourceIndex(0) name (Greeter)
|
||||
5 >Emitted(41, 55) Source(32, 24) + SourceIndex(0) name (Greeter)
|
||||
6 >Emitted(41, 56) Source(32, 25) + SourceIndex(0) name (Greeter)
|
||||
7 >Emitted(41, 58) Source(32, 27) + SourceIndex(0) name (Greeter)
|
||||
8 >Emitted(41, 59) Source(32, 28) + SourceIndex(0) name (Greeter)
|
||||
9 >Emitted(41, 77) Source(33, 36) + SourceIndex(0) name (Greeter)
|
||||
---
|
||||
>>> __decorate([ParameterDecorator1, ParameterDecorator2(20)], Greeter, 0);
|
||||
1 >^^^^
|
||||
|
|
Loading…
Reference in a new issue