Skip to content

Commit

Permalink
Fix: add type_def for GenericTypeForFunctionScope and fix storage f…
Browse files Browse the repository at this point in the history
…ield type_def (FuelLabs#4167)

small bug fix.
  • Loading branch information
JoshuaBatty authored Feb 23, 2023
1 parent d9131a9 commit 1f150cc
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions sway-lsp/src/traverse/typed_tree.rs
Original file line number Diff line number Diff line change
Expand Up @@ -328,9 +328,10 @@ impl<'a> TypedTree<'a> {
}
}
}
ty::TyDeclaration::GenericTypeForFunctionScope { name, .. } => {
ty::TyDeclaration::GenericTypeForFunctionScope { name, type_id } => {
if let Some(mut token) = self.tokens.try_get_mut(&to_ident_key(name)).try_unwrap() {
token.typed = Some(TypedAstToken::TypedDeclaration(declaration.clone()));
token.type_def = Some(TypeDefinition::TypeId(*type_id));
}
}
ty::TyDeclaration::ErrorRecovery(_) => {}
Expand All @@ -345,8 +346,7 @@ impl<'a> TypedTree<'a> {
.try_unwrap()
{
token.typed = Some(TypedAstToken::TypedStorageField(field.clone()));
token.type_def =
Some(TypeDefinition::TypeId(field.type_argument.type_id));
token.type_def = Some(TypeDefinition::Ident(field.name.clone()));
}

self.collect_type_argument(&field.type_argument, namespace);
Expand Down

0 comments on commit 1f150cc

Please sign in to comment.