Skip to content

Commit

Permalink
썩을 또 다른데서 터지네
Browse files Browse the repository at this point in the history
  • Loading branch information
sunrabbit123 committed Aug 19, 2023
1 parent 0d51dc3 commit e2640cb
Show file tree
Hide file tree
Showing 9 changed files with 44 additions and 56 deletions.
12 changes: 11 additions & 1 deletion crates/stc_ts_file_analyzer/src/analyzer/expr/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2181,7 +2181,17 @@ impl Analyzer<'_, '_> {
..self.ctx
};
if let Ok(ty) = self.with_ctx(ctx).access_property(span, constraint, prop, type_mode, id_ctx, opts) {
return Ok(ty);
if let Type::IndexedAccessType(IndexedAccessType {
obj_type: box Type::Param(TypeParam { name: constraint_name, .. }),
..
}) = ty.normalize()
{
if name.eq(constraint_name) {
return Ok(ty);
}
} else {
return Ok(ty);
}
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion crates/stc_ts_file_analyzer/tests/tsc/types/mapped/1.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,4 @@
function f12<T, U extends T>(x: T, y: Partial<U>, k: keyof T) {
x[k] = y[k]; // Error
y[k] = x[k]; // Error
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
"required_error_lines": {},
"extra_errors": {
"TS2345": 9,
"TS2345": 10,
"TS2339": 2,
"TS0": 2,
"TS2322": 8
Expand All @@ -12,7 +11,6 @@
"TS2345": [
96,
132,
157,
162,
291,
295,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Stats {
required_error: 0,
matched_error: 5,
extra_error: 22,
extra_error: 21,
panic: 0,
}
Original file line number Diff line number Diff line change
@@ -1,28 +1,10 @@
{
"required_errors": {
"TS2322": 16,
"TS2536": 4,
"TS2542": 4
"TS2542": 4,
"TS2322": 10
},
"required_error_lines": {
"TS2322": [
14,
19,
33,
43,
44,
64,
75,
81,
91,
130,
146,
151,
156,
161,
166,
171
],
"TS2536": [
23,
24,
Expand All @@ -34,16 +16,35 @@
59,
64,
69
],
"TS2322": [
75,
81,
91,
130,
146,
151,
156,
161,
166,
171
]
},
"extra_errors": {
"TS2322": 4
"TS2322": 11
},
"extra_error_lines": {
"TS2322": [
13,
18,
23,
24,
28,
29,
39,
58,
59,
63,
68
]
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Stats {
required_error: 24,
matched_error: 4,
extra_error: 4,
required_error: 18,
matched_error: 10,
extra_error: 11,
panic: 0,
}

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Stats {
required_error: 1,
matched_error: 9,
extra_error: 4,
required_error: 0,
matched_error: 10,
extra_error: 0,
panic: 0,
}
6 changes: 3 additions & 3 deletions crates/stc_ts_type_checker/tests/tsc-stats.rust-debug
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Stats {
required_error: 3502,
matched_error: 6533,
extra_error: 769,
required_error: 3495,
matched_error: 6540,
extra_error: 770,
panic: 73,
}

0 comments on commit e2640cb

Please sign in to comment.