Skip to content
This repository was archived by the owner on Mar 12, 2025. It is now read-only.
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions crates/stc_ts_file_analyzer/src/analyzer/generic/inference.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1040,6 +1040,8 @@ impl Analyzer<'_, '_> {
if let Some(constraint) = inferred.constraints.get(&name) {
constraint.assert_clone_cheap();

dbg!(&constraint);
dbg!(&arg);
if let Some(false) = self.extends(
span,
&arg,
Expand Down Expand Up @@ -1239,6 +1241,14 @@ impl Analyzer<'_, '_> {

let mut inferred = InferData::default();

for param in type_params {
dbg!(param);
if let Some(constraint) = &param.constraint {
constraint.assert_clone_cheap();
inferred.constraints.insert(param.name.clone(), *constraint.clone());
}
}

self.infer_type(span, &mut inferred, param, arg, InferTypeOpts { ..opts })
.context("tried to infer type using two type")?;

Expand Down
1 change: 1 addition & 0 deletions crates/stc_ts_file_analyzer/src/analyzer/generic/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ impl Analyzer<'_, '_> {

let mut inferred = InferData::default();
for param in type_params {
dbg!(param);
if let Some(constraint) = &param.constraint {
constraint.assert_clone_cheap();
inferred.constraints.insert(param.name.clone(), *constraint.clone());
Expand Down