-
Notifications
You must be signed in to change notification settings - Fork 12.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* Manual port of #51704 * Add a testcase
- Loading branch information
1 parent
b4d382b
commit eb5419f
Showing
6 changed files
with
49 additions
and
1 deletion.
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
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,13 @@ | ||
tests/cases/compiler/satisfiesEmit.ts(2,20): error TS2307: Cannot find module 'foo' or its corresponding type declarations. | ||
tests/cases/compiler/satisfiesEmit.ts(3,23): error TS2304: Cannot find name 'bleh'. | ||
|
||
|
||
==== tests/cases/compiler/satisfiesEmit.ts (2 errors) ==== | ||
// This import should not be elided in the emitted JS | ||
import a = require("foo"); | ||
~~~~~ | ||
!!! error TS2307: Cannot find module 'foo' or its corresponding type declarations. | ||
const p = a satisfies bleh; | ||
~~~~ | ||
!!! error TS2304: Cannot find name 'bleh'. | ||
|
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,12 @@ | ||
//// [satisfiesEmit.ts] | ||
// This import should not be elided in the emitted JS | ||
import a = require("foo"); | ||
const p = a satisfies bleh; | ||
|
||
|
||
//// [satisfiesEmit.js] | ||
"use strict"; | ||
exports.__esModule = true; | ||
// This import should not be elided in the emitted JS | ||
var a = require("foo"); | ||
var p = a; |
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/satisfiesEmit.ts === | ||
// This import should not be elided in the emitted JS | ||
import a = require("foo"); | ||
>a : Symbol(a, Decl(satisfiesEmit.ts, 0, 0)) | ||
|
||
const p = a satisfies bleh; | ||
>p : Symbol(p, Decl(satisfiesEmit.ts, 2, 5)) | ||
>a : Symbol(a, Decl(satisfiesEmit.ts, 0, 0)) | ||
>bleh : Symbol(bleh) | ||
|
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/satisfiesEmit.ts === | ||
// This import should not be elided in the emitted JS | ||
import a = require("foo"); | ||
>a : any | ||
|
||
const p = a satisfies bleh; | ||
>p : bleh | ||
>a satisfies bleh : bleh | ||
>a : 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 @@ | ||
// This import should not be elided in the emitted JS | ||
import a = require("foo"); | ||
const p = a satisfies bleh; |