-
-
Notifications
You must be signed in to change notification settings - Fork 166
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Implement
this
types in method parameters (#1062)
**Description:** ```ts // @strictNullChecks: true // @declaration: true class A<T> { props: T & { foo: string }; } class B extends A<{ x: number}> { f(p: this["props"]) { p.x; } } ```
- Loading branch information
1 parent
9d957b4
commit 0130bbe
Showing
5 changed files
with
23 additions
and
8 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
13 changes: 13 additions & 0 deletions
13
crates/stc_ts_file_analyzer/tests/pass-only/types/keyof/2.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 |
---|---|---|
@@ -0,0 +1,13 @@ | ||
// @strictNullChecks: true | ||
// @declaration: true | ||
|
||
|
||
class A<T> { | ||
props: T & { foo: string }; | ||
} | ||
|
||
class B extends A<{ x: number}> { | ||
f(p: this["props"]) { | ||
p.x; | ||
} | ||
} |
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
2 changes: 1 addition & 1 deletion
2
.../stc_ts_type_checker/tests/conformance/types/keyof/keyofAndIndexedAccess.stats.rust-debug
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,6 +1,6 @@ | ||
Stats { | ||
required_error: 0, | ||
matched_error: 5, | ||
extra_error: 23, | ||
extra_error: 22, | ||
panic: 0, | ||
} |
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,6 +1,6 @@ | ||
Stats { | ||
required_error: 3502, | ||
matched_error: 6533, | ||
extra_error: 767, | ||
extra_error: 766, | ||
panic: 74, | ||
} |