-
Notifications
You must be signed in to change notification settings - Fork 12.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
🤖 Pick PR #60680 (Mark the inherited any-based index ...) into releas…
…e-5.7 (#60776) Co-authored-by: Wesley Wigham <[email protected]>
- Loading branch information
1 parent
e844dc3
commit 4b7441a
Showing
5 changed files
with
76 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
45 changes: 45 additions & 0 deletions
45
tests/baselines/reference/declarationEmitClassInherritsAny.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
//// [tests/cases/compiler/declarationEmitClassInherritsAny.ts] //// | ||
|
||
//// [declarationEmitClassInherritsAny.ts] | ||
const anyThing = class {} as any; | ||
export class Foo extends anyThing {} | ||
|
||
//// [declarationEmitClassInherritsAny.js] | ||
"use strict"; | ||
var __extends = (this && this.__extends) || (function () { | ||
var extendStatics = function (d, b) { | ||
extendStatics = Object.setPrototypeOf || | ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || | ||
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; | ||
return extendStatics(d, b); | ||
}; | ||
return function (d, b) { | ||
if (typeof b !== "function" && b !== null) | ||
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); | ||
extendStatics(d, b); | ||
function __() { this.constructor = d; } | ||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); | ||
}; | ||
})(); | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.Foo = void 0; | ||
var anyThing = /** @class */ (function () { | ||
function class_1() { | ||
} | ||
return class_1; | ||
}()); | ||
var Foo = /** @class */ (function (_super) { | ||
__extends(Foo, _super); | ||
function Foo() { | ||
return _super !== null && _super.apply(this, arguments) || this; | ||
} | ||
return Foo; | ||
}(anyThing)); | ||
exports.Foo = Foo; | ||
|
||
|
||
//// [declarationEmitClassInherritsAny.d.ts] | ||
declare const anyThing: any; | ||
export declare class Foo extends anyThing { | ||
} | ||
export {}; |
10 changes: 10 additions & 0 deletions
10
tests/baselines/reference/declarationEmitClassInherritsAny.symbols
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
//// [tests/cases/compiler/declarationEmitClassInherritsAny.ts] //// | ||
|
||
=== declarationEmitClassInherritsAny.ts === | ||
const anyThing = class {} as any; | ||
>anyThing : Symbol(anyThing, Decl(declarationEmitClassInherritsAny.ts, 0, 5)) | ||
|
||
export class Foo extends anyThing {} | ||
>Foo : Symbol(Foo, Decl(declarationEmitClassInherritsAny.ts, 0, 33)) | ||
>anyThing : Symbol(anyThing, Decl(declarationEmitClassInherritsAny.ts, 0, 5)) | ||
|
14 changes: 14 additions & 0 deletions
14
tests/baselines/reference/declarationEmitClassInherritsAny.types
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
//// [tests/cases/compiler/declarationEmitClassInherritsAny.ts] //// | ||
|
||
=== declarationEmitClassInherritsAny.ts === | ||
const anyThing = class {} as any; | ||
>anyThing : any | ||
>class {} as any : any | ||
>class {} : typeof (Anonymous class) | ||
> : ^^^^^^^^^^^^^^^^^^^^^^^^ | ||
|
||
export class Foo extends anyThing {} | ||
>Foo : Foo | ||
> : ^^^ | ||
>anyThing : any | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
// @declaration: true | ||
const anyThing = class {} as any; | ||
export class Foo extends anyThing {} |