Skip to content

Commit 5450bc7

Browse files
Accepted baselines.
1 parent 35cfcff commit 5450bc7

6 files changed

+109
-47
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
tests/cases/conformance/decorators/class/method/decoratorOnClassMethod6.ts(4,5): error TS1329: This value has type '() => <T>(target: any, propertyKey: string, descriptor: TypedPropertyDescriptor<T>) => TypedPropertyDescriptor<T>' which accepts too few arguments to be used as a decorator here. Did you mean to call it first?
1+
tests/cases/conformance/decorators/class/method/decoratorOnClassMethod6.ts(4,5): error TS1329: 'dec' accepts too few arguments to be used as a decorator here. Did you mean to call it first and write '@dec()'?
22

33

44
==== tests/cases/conformance/decorators/class/method/decoratorOnClassMethod6.ts (1 errors) ====
@@ -7,5 +7,5 @@ tests/cases/conformance/decorators/class/method/decoratorOnClassMethod6.ts(4,5):
77
class C {
88
@dec ["method"]() {}
99
~~~~
10-
!!! error TS1329: This value has type '() => <T>(target: any, propertyKey: string, descriptor: TypedPropertyDescriptor<T>) => TypedPropertyDescriptor<T>' which accepts too few arguments to be used as a decorator here. Did you mean to call it first?
10+
!!! error TS1329: 'dec' accepts too few arguments to be used as a decorator here. Did you mean to call it first and write '@dec()'?
1111
}
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
tests/cases/conformance/decorators/class/property/decoratorOnClassProperty11.ts(4,5): error TS1329: This value has type '() => <T>(target: any, propertyKey: string) => void' which accepts too few arguments to be used as a decorator here. Did you mean to call it first?
1+
tests/cases/conformance/decorators/class/property/decoratorOnClassProperty11.ts(4,5): error TS1329: 'dec' accepts too few arguments to be used as a decorator here. Did you mean to call it first and write '@dec()'?
22

33

44
==== tests/cases/conformance/decorators/class/property/decoratorOnClassProperty11.ts (1 errors) ====
@@ -7,5 +7,5 @@ tests/cases/conformance/decorators/class/property/decoratorOnClassProperty11.ts(
77
class C {
88
@dec prop;
99
~~~~
10-
!!! error TS1329: This value has type '() => <T>(target: any, propertyKey: string) => void' which accepts too few arguments to be used as a decorator here. Did you mean to call it first?
10+
!!! error TS1329: 'dec' accepts too few arguments to be used as a decorator here. Did you mean to call it first and write '@dec()'?
1111
}

tests/baselines/reference/potentiallyUncalledDecorators.errors.txt

+32-25
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,39 @@
1-
tests/cases/compiler/potentiallyUncalledDecorators.ts(4,5): error TS1329: This value has type '(bindingPropertyName?: string) => any' which accepts too few arguments to be used as a decorator here. Did you mean to call it first?
2-
tests/cases/compiler/potentiallyUncalledDecorators.ts(34,1): error TS1329: This value has type '() => OmniDecorator' which accepts too few arguments to be used as a decorator here. Did you mean to call it first?
3-
tests/cases/compiler/potentiallyUncalledDecorators.ts(36,5): error TS1329: This value has type '() => OmniDecorator' which accepts too few arguments to be used as a decorator here. Did you mean to call it first?
4-
tests/cases/compiler/potentiallyUncalledDecorators.ts(37,5): error TS1329: This value has type '() => OmniDecorator' which accepts too few arguments to be used as a decorator here. Did you mean to call it first?
5-
tests/cases/compiler/potentiallyUncalledDecorators.ts(40,1): error TS1238: Unable to resolve signature of class decorator when called as an expression.
1+
tests/cases/compiler/potentiallyUncalledDecorators.ts(4,5): error TS1329: 'Input' accepts too few arguments to be used as a decorator here. Did you mean to call it first and write '@Input()'?
2+
tests/cases/compiler/potentiallyUncalledDecorators.ts(35,1): error TS1329: 'noArgs' accepts too few arguments to be used as a decorator here. Did you mean to call it first and write '@noArgs()'?
3+
tests/cases/compiler/potentiallyUncalledDecorators.ts(37,5): error TS1329: 'noArgs' accepts too few arguments to be used as a decorator here. Did you mean to call it first and write '@noArgs()'?
4+
tests/cases/compiler/potentiallyUncalledDecorators.ts(38,5): error TS1329: 'noArgs' accepts too few arguments to be used as a decorator here. Did you mean to call it first and write '@noArgs()'?
5+
tests/cases/compiler/potentiallyUncalledDecorators.ts(41,1): error TS1238: Unable to resolve signature of class decorator when called as an expression.
66
Type 'OmniDecorator' is not assignable to type 'typeof B'.
77
Type 'OmniDecorator' provides no match for the signature 'new (): B'.
8-
tests/cases/compiler/potentiallyUncalledDecorators.ts(42,5): error TS1236: The return type of a property decorator function must be either 'void' or 'any'.
8+
tests/cases/compiler/potentiallyUncalledDecorators.ts(43,5): error TS1236: The return type of a property decorator function must be either 'void' or 'any'.
99
Unable to resolve signature of property decorator when called as an expression.
10-
tests/cases/compiler/potentiallyUncalledDecorators.ts(43,5): error TS1241: Unable to resolve signature of method decorator when called as an expression.
10+
tests/cases/compiler/potentiallyUncalledDecorators.ts(44,5): error TS1241: Unable to resolve signature of method decorator when called as an expression.
1111
Type 'OmniDecorator' has no properties in common with type 'TypedPropertyDescriptor<() => void>'.
12-
tests/cases/compiler/potentiallyUncalledDecorators.ts(46,1): error TS1238: Unable to resolve signature of class decorator when called as an expression.
12+
tests/cases/compiler/potentiallyUncalledDecorators.ts(47,1): error TS1238: Unable to resolve signature of class decorator when called as an expression.
1313
Type 'OmniDecorator' is not assignable to type 'typeof C'.
1414
Type 'OmniDecorator' provides no match for the signature 'new (): C'.
15-
tests/cases/compiler/potentiallyUncalledDecorators.ts(48,5): error TS1329: This value has type '(x?: any) => OmniDecorator' which accepts too few arguments to be used as a decorator here. Did you mean to call it first?
16-
tests/cases/compiler/potentiallyUncalledDecorators.ts(49,5): error TS1329: This value has type '(x?: any) => OmniDecorator' which accepts too few arguments to be used as a decorator here. Did you mean to call it first?
17-
tests/cases/compiler/potentiallyUncalledDecorators.ts(52,1): error TS1238: Unable to resolve signature of class decorator when called as an expression.
15+
tests/cases/compiler/potentiallyUncalledDecorators.ts(49,5): error TS1329: 'oneOptional' accepts too few arguments to be used as a decorator here. Did you mean to call it first and write '@oneOptional()'?
16+
tests/cases/compiler/potentiallyUncalledDecorators.ts(50,5): error TS1329: 'oneOptional' accepts too few arguments to be used as a decorator here. Did you mean to call it first and write '@oneOptional()'?
17+
tests/cases/compiler/potentiallyUncalledDecorators.ts(53,1): error TS1238: Unable to resolve signature of class decorator when called as an expression.
1818
Type 'OmniDecorator' is not assignable to type 'typeof D'.
1919
Type 'OmniDecorator' provides no match for the signature 'new (): D'.
20-
tests/cases/compiler/potentiallyUncalledDecorators.ts(54,5): error TS1236: The return type of a property decorator function must be either 'void' or 'any'.
20+
tests/cases/compiler/potentiallyUncalledDecorators.ts(55,5): error TS1236: The return type of a property decorator function must be either 'void' or 'any'.
2121
Unable to resolve signature of property decorator when called as an expression.
22-
tests/cases/compiler/potentiallyUncalledDecorators.ts(55,5): error TS1241: Unable to resolve signature of method decorator when called as an expression.
22+
tests/cases/compiler/potentiallyUncalledDecorators.ts(56,5): error TS1241: Unable to resolve signature of method decorator when called as an expression.
2323
Type 'OmniDecorator' has no properties in common with type 'TypedPropertyDescriptor<() => void>'.
24-
tests/cases/compiler/potentiallyUncalledDecorators.ts(58,1): error TS1238: Unable to resolve signature of class decorator when called as an expression.
24+
tests/cases/compiler/potentiallyUncalledDecorators.ts(59,1): error TS1238: Unable to resolve signature of class decorator when called as an expression.
2525
Type 'OmniDecorator' is not assignable to type 'typeof E'.
2626
Type 'OmniDecorator' provides no match for the signature 'new (): E'.
27-
tests/cases/compiler/potentiallyUncalledDecorators.ts(60,5): error TS1236: The return type of a property decorator function must be either 'void' or 'any'.
27+
tests/cases/compiler/potentiallyUncalledDecorators.ts(61,5): error TS1236: The return type of a property decorator function must be either 'void' or 'any'.
2828
Unable to resolve signature of property decorator when called as an expression.
29-
tests/cases/compiler/potentiallyUncalledDecorators.ts(61,5): error TS1241: Unable to resolve signature of method decorator when called as an expression.
29+
tests/cases/compiler/potentiallyUncalledDecorators.ts(62,5): error TS1241: Unable to resolve signature of method decorator when called as an expression.
3030
Type 'OmniDecorator' has no properties in common with type 'TypedPropertyDescriptor<() => void>'.
31-
tests/cases/compiler/potentiallyUncalledDecorators.ts(64,1): error TS1238: Unable to resolve signature of class decorator when called as an expression.
31+
tests/cases/compiler/potentiallyUncalledDecorators.ts(65,1): error TS1238: Unable to resolve signature of class decorator when called as an expression.
3232
Type 'OmniDecorator' is not assignable to type 'typeof F'.
3333
Type 'OmniDecorator' provides no match for the signature 'new (): F'.
34-
tests/cases/compiler/potentiallyUncalledDecorators.ts(66,5): error TS1236: The return type of a property decorator function must be either 'void' or 'any'.
34+
tests/cases/compiler/potentiallyUncalledDecorators.ts(67,5): error TS1236: The return type of a property decorator function must be either 'void' or 'any'.
3535
Unable to resolve signature of property decorator when called as an expression.
36-
tests/cases/compiler/potentiallyUncalledDecorators.ts(67,5): error TS1241: Unable to resolve signature of method decorator when called as an expression.
36+
tests/cases/compiler/potentiallyUncalledDecorators.ts(68,5): error TS1241: Unable to resolve signature of method decorator when called as an expression.
3737
Type 'OmniDecorator' has no properties in common with type 'TypedPropertyDescriptor<() => void>'.
3838

3939

@@ -43,7 +43,7 @@ tests/cases/compiler/potentiallyUncalledDecorators.ts(67,5): error TS1241: Unabl
4343
class FooComponent {
4444
@Input foo: string;
4545
~~~~~~
46-
!!! error TS1329: This value has type '(bindingPropertyName?: string) => any' which accepts too few arguments to be used as a decorator here. Did you mean to call it first?
46+
!!! error TS1329: 'Input' accepts too few arguments to be used as a decorator here. Did you mean to call it first and write '@Input()'?
4747
}
4848

4949
// Glimmer-style tracked API:
@@ -72,17 +72,18 @@ tests/cases/compiler/potentiallyUncalledDecorators.ts(67,5): error TS1241: Unabl
7272
declare function twoOptional(x?: any, y?: any): OmniDecorator;
7373
declare function threeOptional(x?: any, y?: any, z?: any): OmniDecorator;
7474
declare function oneOptionalWithRest(x?: any, ...args: any[]): OmniDecorator;
75+
declare const anyDec: any;
7576

7677
@noArgs
7778
~~~~~~~
78-
!!! error TS1329: This value has type '() => OmniDecorator' which accepts too few arguments to be used as a decorator here. Did you mean to call it first?
79+
!!! error TS1329: 'noArgs' accepts too few arguments to be used as a decorator here. Did you mean to call it first and write '@noArgs()'?
7980
class A {
8081
@noArgs foo: any;
8182
~~~~~~~
82-
!!! error TS1329: This value has type '() => OmniDecorator' which accepts too few arguments to be used as a decorator here. Did you mean to call it first?
83+
!!! error TS1329: 'noArgs' accepts too few arguments to be used as a decorator here. Did you mean to call it first and write '@noArgs()'?
8384
@noArgs bar() { }
8485
~~~~~~~
85-
!!! error TS1329: This value has type '() => OmniDecorator' which accepts too few arguments to be used as a decorator here. Did you mean to call it first?
86+
!!! error TS1329: 'noArgs' accepts too few arguments to be used as a decorator here. Did you mean to call it first and write '@noArgs()'?
8687
}
8788

8889
@allRest
@@ -109,10 +110,10 @@ tests/cases/compiler/potentiallyUncalledDecorators.ts(67,5): error TS1241: Unabl
109110
class C {
110111
@oneOptional foo: any;
111112
~~~~~~~~~~~~
112-
!!! error TS1329: This value has type '(x?: any) => OmniDecorator' which accepts too few arguments to be used as a decorator here. Did you mean to call it first?
113+
!!! error TS1329: 'oneOptional' accepts too few arguments to be used as a decorator here. Did you mean to call it first and write '@oneOptional()'?
113114
@oneOptional bar() { }
114115
~~~~~~~~~~~~
115-
!!! error TS1329: This value has type '(x?: any) => OmniDecorator' which accepts too few arguments to be used as a decorator here. Did you mean to call it first?
116+
!!! error TS1329: 'oneOptional' accepts too few arguments to be used as a decorator here. Did you mean to call it first and write '@oneOptional()'?
116117
}
117118

118119
@twoOptional
@@ -163,5 +164,11 @@ tests/cases/compiler/potentiallyUncalledDecorators.ts(67,5): error TS1241: Unabl
163164
!!! error TS1241: Type 'OmniDecorator' has no properties in common with type 'TypedPropertyDescriptor<() => void>'.
164165
}
165166

167+
@anyDec
168+
class G {
169+
@anyDec foo: any;
170+
@anyDec bar() { }
171+
}
172+
166173
export { };
167174

tests/baselines/reference/potentiallyUncalledDecorators.js

+19
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ declare function oneOptional(x?: any): OmniDecorator;
3131
declare function twoOptional(x?: any, y?: any): OmniDecorator;
3232
declare function threeOptional(x?: any, y?: any, z?: any): OmniDecorator;
3333
declare function oneOptionalWithRest(x?: any, ...args: any[]): OmniDecorator;
34+
declare const anyDec: any;
3435

3536
@noArgs
3637
class A {
@@ -68,6 +69,12 @@ class F {
6869
@oneOptionalWithRest bar() { }
6970
}
7071

72+
@anyDec
73+
class G {
74+
@anyDec foo: any;
75+
@anyDec bar() { }
76+
}
77+
7178
export { };
7279

7380

@@ -168,3 +175,15 @@ __decorate([
168175
F = __decorate([
169176
oneOptionalWithRest
170177
], F);
178+
let G = class G {
179+
bar() { }
180+
};
181+
__decorate([
182+
anyDec
183+
], G.prototype, "foo", void 0);
184+
__decorate([
185+
anyDec
186+
], G.prototype, "bar", null);
187+
G = __decorate([
188+
anyDec
189+
], G);

tests/baselines/reference/potentiallyUncalledDecorators.symbols

+36-18
Original file line numberDiff line numberDiff line change
@@ -88,94 +88,112 @@ declare function oneOptionalWithRest(x?: any, ...args: any[]): OmniDecorator;
8888
>args : Symbol(args, Decl(potentiallyUncalledDecorators.ts, 31, 45))
8989
>OmniDecorator : Symbol(OmniDecorator, Decl(potentiallyUncalledDecorators.ts, 19, 1))
9090

91+
declare const anyDec: any;
92+
>anyDec : Symbol(anyDec, Decl(potentiallyUncalledDecorators.ts, 32, 13))
93+
9194
@noArgs
9295
>noArgs : Symbol(noArgs, Decl(potentiallyUncalledDecorators.ts, 24, 1))
9396

9497
class A {
95-
>A : Symbol(A, Decl(potentiallyUncalledDecorators.ts, 31, 77))
98+
>A : Symbol(A, Decl(potentiallyUncalledDecorators.ts, 32, 26))
9699

97100
@noArgs foo: any;
98101
>noArgs : Symbol(noArgs, Decl(potentiallyUncalledDecorators.ts, 24, 1))
99-
>foo : Symbol(A.foo, Decl(potentiallyUncalledDecorators.ts, 34, 9))
102+
>foo : Symbol(A.foo, Decl(potentiallyUncalledDecorators.ts, 35, 9))
100103

101104
@noArgs bar() { }
102105
>noArgs : Symbol(noArgs, Decl(potentiallyUncalledDecorators.ts, 24, 1))
103-
>bar : Symbol(A.bar, Decl(potentiallyUncalledDecorators.ts, 35, 21))
106+
>bar : Symbol(A.bar, Decl(potentiallyUncalledDecorators.ts, 36, 21))
104107
}
105108

106109
@allRest
107110
>allRest : Symbol(allRest, Decl(potentiallyUncalledDecorators.ts, 26, 41))
108111

109112
class B {
110-
>B : Symbol(B, Decl(potentiallyUncalledDecorators.ts, 37, 1))
113+
>B : Symbol(B, Decl(potentiallyUncalledDecorators.ts, 38, 1))
111114

112115
@allRest foo: any;
113116
>allRest : Symbol(allRest, Decl(potentiallyUncalledDecorators.ts, 26, 41))
114-
>foo : Symbol(B.foo, Decl(potentiallyUncalledDecorators.ts, 40, 9))
117+
>foo : Symbol(B.foo, Decl(potentiallyUncalledDecorators.ts, 41, 9))
115118

116119
@allRest bar() { }
117120
>allRest : Symbol(allRest, Decl(potentiallyUncalledDecorators.ts, 26, 41))
118-
>bar : Symbol(B.bar, Decl(potentiallyUncalledDecorators.ts, 41, 22))
121+
>bar : Symbol(B.bar, Decl(potentiallyUncalledDecorators.ts, 42, 22))
119122
}
120123

121124
@oneOptional
122125
>oneOptional : Symbol(oneOptional, Decl(potentiallyUncalledDecorators.ts, 27, 56))
123126

124127
class C {
125-
>C : Symbol(C, Decl(potentiallyUncalledDecorators.ts, 43, 1))
128+
>C : Symbol(C, Decl(potentiallyUncalledDecorators.ts, 44, 1))
126129

127130
@oneOptional foo: any;
128131
>oneOptional : Symbol(oneOptional, Decl(potentiallyUncalledDecorators.ts, 27, 56))
129-
>foo : Symbol(C.foo, Decl(potentiallyUncalledDecorators.ts, 46, 9))
132+
>foo : Symbol(C.foo, Decl(potentiallyUncalledDecorators.ts, 47, 9))
130133

131134
@oneOptional bar() { }
132135
>oneOptional : Symbol(oneOptional, Decl(potentiallyUncalledDecorators.ts, 27, 56))
133-
>bar : Symbol(C.bar, Decl(potentiallyUncalledDecorators.ts, 47, 26))
136+
>bar : Symbol(C.bar, Decl(potentiallyUncalledDecorators.ts, 48, 26))
134137
}
135138

136139
@twoOptional
137140
>twoOptional : Symbol(twoOptional, Decl(potentiallyUncalledDecorators.ts, 28, 53))
138141

139142
class D {
140-
>D : Symbol(D, Decl(potentiallyUncalledDecorators.ts, 49, 1))
143+
>D : Symbol(D, Decl(potentiallyUncalledDecorators.ts, 50, 1))
141144

142145
@twoOptional foo: any;
143146
>twoOptional : Symbol(twoOptional, Decl(potentiallyUncalledDecorators.ts, 28, 53))
144-
>foo : Symbol(D.foo, Decl(potentiallyUncalledDecorators.ts, 52, 9))
147+
>foo : Symbol(D.foo, Decl(potentiallyUncalledDecorators.ts, 53, 9))
145148

146149
@twoOptional bar() { }
147150
>twoOptional : Symbol(twoOptional, Decl(potentiallyUncalledDecorators.ts, 28, 53))
148-
>bar : Symbol(D.bar, Decl(potentiallyUncalledDecorators.ts, 53, 26))
151+
>bar : Symbol(D.bar, Decl(potentiallyUncalledDecorators.ts, 54, 26))
149152
}
150153

151154
@threeOptional
152155
>threeOptional : Symbol(threeOptional, Decl(potentiallyUncalledDecorators.ts, 29, 62))
153156

154157
class E {
155-
>E : Symbol(E, Decl(potentiallyUncalledDecorators.ts, 55, 1))
158+
>E : Symbol(E, Decl(potentiallyUncalledDecorators.ts, 56, 1))
156159

157160
@threeOptional foo: any;
158161
>threeOptional : Symbol(threeOptional, Decl(potentiallyUncalledDecorators.ts, 29, 62))
159-
>foo : Symbol(E.foo, Decl(potentiallyUncalledDecorators.ts, 58, 9))
162+
>foo : Symbol(E.foo, Decl(potentiallyUncalledDecorators.ts, 59, 9))
160163

161164
@threeOptional bar() { }
162165
>threeOptional : Symbol(threeOptional, Decl(potentiallyUncalledDecorators.ts, 29, 62))
163-
>bar : Symbol(E.bar, Decl(potentiallyUncalledDecorators.ts, 59, 28))
166+
>bar : Symbol(E.bar, Decl(potentiallyUncalledDecorators.ts, 60, 28))
164167
}
165168

166169
@oneOptionalWithRest
167170
>oneOptionalWithRest : Symbol(oneOptionalWithRest, Decl(potentiallyUncalledDecorators.ts, 30, 73))
168171

169172
class F {
170-
>F : Symbol(F, Decl(potentiallyUncalledDecorators.ts, 61, 1))
173+
>F : Symbol(F, Decl(potentiallyUncalledDecorators.ts, 62, 1))
171174

172175
@oneOptionalWithRest foo: any;
173176
>oneOptionalWithRest : Symbol(oneOptionalWithRest, Decl(potentiallyUncalledDecorators.ts, 30, 73))
174-
>foo : Symbol(F.foo, Decl(potentiallyUncalledDecorators.ts, 64, 9))
177+
>foo : Symbol(F.foo, Decl(potentiallyUncalledDecorators.ts, 65, 9))
175178

176179
@oneOptionalWithRest bar() { }
177180
>oneOptionalWithRest : Symbol(oneOptionalWithRest, Decl(potentiallyUncalledDecorators.ts, 30, 73))
178-
>bar : Symbol(F.bar, Decl(potentiallyUncalledDecorators.ts, 65, 34))
181+
>bar : Symbol(F.bar, Decl(potentiallyUncalledDecorators.ts, 66, 34))
182+
}
183+
184+
@anyDec
185+
>anyDec : Symbol(anyDec, Decl(potentiallyUncalledDecorators.ts, 32, 13))
186+
187+
class G {
188+
>G : Symbol(G, Decl(potentiallyUncalledDecorators.ts, 68, 1))
189+
190+
@anyDec foo: any;
191+
>anyDec : Symbol(anyDec, Decl(potentiallyUncalledDecorators.ts, 32, 13))
192+
>foo : Symbol(G.foo, Decl(potentiallyUncalledDecorators.ts, 71, 9))
193+
194+
@anyDec bar() { }
195+
>anyDec : Symbol(anyDec, Decl(potentiallyUncalledDecorators.ts, 32, 13))
196+
>bar : Symbol(G.bar, Decl(potentiallyUncalledDecorators.ts, 72, 21))
179197
}
180198

181199
export { };

tests/baselines/reference/potentiallyUncalledDecorators.types

+18
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,9 @@ declare function oneOptionalWithRest(x?: any, ...args: any[]): OmniDecorator;
9494
>args : any[]
9595
>OmniDecorator : OmniDecorator
9696

97+
declare const anyDec: any;
98+
>anyDec : any
99+
97100
@noArgs
98101
>noArgs : () => OmniDecorator
99102

@@ -184,5 +187,20 @@ class F {
184187
>bar : () => void
185188
}
186189

190+
@anyDec
191+
>anyDec : any
192+
193+
class G {
194+
>G : G
195+
196+
@anyDec foo: any;
197+
>anyDec : any
198+
>foo : any
199+
200+
@anyDec bar() { }
201+
>anyDec : any
202+
>bar : () => void
203+
}
204+
187205
export { };
188206

0 commit comments

Comments
 (0)