|
| 1 | +tests/cases/compiler/BaseB.js(2,24): error TS8004: 'type parameter declarations' can only be used in a .ts file. |
| 2 | +tests/cases/compiler/BaseB.js(2,25): error TS1005: ',' expected. |
| 3 | +tests/cases/compiler/BaseB.js(3,14): error TS2304: Cannot find name 'Class'. |
| 4 | +tests/cases/compiler/BaseB.js(3,14): error TS8010: 'types' can only be used in a .ts file. |
| 5 | +tests/cases/compiler/BaseB.js(4,25): error TS2304: Cannot find name 'Class'. |
| 6 | +tests/cases/compiler/BaseB.js(4,25): error TS8010: 'types' can only be used in a .ts file. |
| 7 | +tests/cases/compiler/SubB.js(3,41): error TS8011: 'type arguments' can only be used in a .ts file. |
| 8 | + |
| 9 | + |
| 10 | +==== tests/cases/compiler/BaseA.js (0 errors) ==== |
| 11 | + // regression test for #18254 |
| 12 | + export default class BaseA { |
| 13 | + } |
| 14 | +==== tests/cases/compiler/SubA.js (0 errors) ==== |
| 15 | + import BaseA from './BaseA'; |
| 16 | + export default class SubA extends BaseA { |
| 17 | + } |
| 18 | +==== tests/cases/compiler/BaseB.js (6 errors) ==== |
| 19 | + import BaseA from './BaseA'; |
| 20 | + export default class B<T: BaseA> { |
| 21 | + ~~~~~~~~ |
| 22 | +!!! error TS8004: 'type parameter declarations' can only be used in a .ts file. |
| 23 | + ~ |
| 24 | +!!! error TS1005: ',' expected. |
| 25 | + _AClass: Class<T>; |
| 26 | + ~~~~~ |
| 27 | +!!! error TS2304: Cannot find name 'Class'. |
| 28 | + ~~~~~~~~ |
| 29 | +!!! error TS8010: 'types' can only be used in a .ts file. |
| 30 | + constructor(AClass: Class<T>) { |
| 31 | + ~~~~~ |
| 32 | +!!! error TS2304: Cannot find name 'Class'. |
| 33 | + ~~~~~~~~ |
| 34 | +!!! error TS8010: 'types' can only be used in a .ts file. |
| 35 | + this._AClass = AClass; |
| 36 | + } |
| 37 | + } |
| 38 | +==== tests/cases/compiler/SubB.js (1 errors) ==== |
| 39 | + import SubA from './SubA'; |
| 40 | + import BaseB from './BaseB'; |
| 41 | + export default class SubB extends BaseB<SubA> { |
| 42 | + ~~~~ |
| 43 | +!!! error TS8011: 'type arguments' can only be used in a .ts file. |
| 44 | + constructor() { |
| 45 | + super(SubA); |
| 46 | + } |
| 47 | + } |
| 48 | + |
0 commit comments