Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Resolve string idents from scope #12

Merged
merged 1 commit into from Mar 7, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/evaluator.rs
Expand Up @@ -240,7 +240,8 @@ impl<'a> Evaluator<'a> {
| component::Type::S8
| component::Type::S16
| component::Type::S32
| component::Type::S64 => self.lookup_in_scope(ident),
| component::Type::S64
| component::Type::String => self.lookup_in_scope(ident),
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm trying to remember why we wouldn't just always look up in scope if it's not one of the special types we'd like to handle... I wonder if we should instead get rid of this arm and turn it into:

_ => self.lookup_in_scope(ident)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm happy to provide an additional PR to head into that direction. Unfortunately, I saw your comment after you merged the PR

t => todo!("handle ident '{ident}' with type {t:?}"),
},
None => self.lookup_in_scope(ident),
Expand Down