Skip to content

Commit

Permalink
Fix type checking bug
Browse files Browse the repository at this point in the history
  • Loading branch information
Rigidity committed Apr 17, 2024
1 parent 8acd693 commit bea2c95
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions crates/rue-compiler/src/lowerer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1332,7 +1332,7 @@ impl<'a> Lowerer<'a> {
self.type_check(output.ty(), expected_item_type, item.syntax().text_range());
}

if i + 1 == len && list_type.is_none() {
if i == 0 && item_type.is_none() {
if item.spread().is_some() {
list_type = Some(output.ty());
item_type = match self.db.ty(output.ty()) {
Expand Down Expand Up @@ -1368,7 +1368,8 @@ impl<'a> Lowerer<'a> {

Value::typed(
hir_id,
list_type.unwrap_or_else(|| self.db.alloc_type(Type::List(self.unknown_type), None)),
self.db
.alloc_type(Type::List(item_type.unwrap_or(self.unknown_type)), None),
)
}

Expand Down

0 comments on commit bea2c95

Please sign in to comment.