-
-
Notifications
You must be signed in to change notification settings - Fork 474
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(isolated-declarations): inferring of UnrayExpression incorrectly (#…
- Loading branch information
Showing
5 changed files
with
75 additions
and
6 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
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
15 changes: 14 additions & 1 deletion
15
crates/oxc_isolated_declarations/tests/fixtures/infer-expression.ts
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 |
---|---|---|
@@ -1,5 +1,18 @@ | ||
// Correct | ||
|
||
// ParenthesizedExpression | ||
const n = (0); | ||
const s = (""); | ||
const t = (``); | ||
const b = (true); | ||
const b = (true); | ||
|
||
// UnaryExpression | ||
let unaryA = +12; | ||
const unaryB = -1_2n; | ||
|
||
// Incorrect | ||
|
||
// UnaryExpression | ||
const unaryC = +"str" | ||
const unaryD = typeof "str" | ||
const unaryE = {E: -"str"} as const |
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