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

compile-time error handling #421

Open
smcclellan opened this issue Jun 4, 2024 · 3 comments
Open

compile-time error handling #421

smcclellan opened this issue Jun 4, 2024 · 3 comments

Comments

@smcclellan
Copy link
Collaborator

There are several places in the code where an InternalError is being thrown, wrapping an Unchecked. This should use the proper underlying error to match the interpreter instead.

@csgui
Copy link
Collaborator

csgui commented Jun 5, 2024

Adding more details.

Consider the following expression, that should throw an error: (let ((map 2)) (+ map map)).

Such expressions cause the interpreter to throw an Unchecked(NameAlreadyUsed("map")) while the compiler is handling this error as a GeneratorError::InternalError(…).

The compiler should reflect how the interpreter handles the error. Ideally working with these errors from stacks-core.

The generic GeneratorError::InternalError(…) should really just be used for cases that we don't expect to show up.

@csgui csgui changed the title Add Unchecked error handling Compile-time error handling Jun 5, 2024
@csgui csgui changed the title Compile-time error handling compile-time error handling Jun 5, 2024
@csgui csgui added missing Some missing functionality that is required for v1.0 and removed missing Some missing functionality that is required for v1.0 labels Jun 5, 2024
@csgui csgui added this to the WASM Phase 1 milestone Jun 5, 2024
@Acaccia
Copy link
Collaborator

Acaccia commented Jun 6, 2024

@csgui @smcclellan I don’t understand this issue. Why does it exist, when #386 exists and was closed because we already have InternalErrors ?

@csgui
Copy link
Collaborator

csgui commented Jun 6, 2024

@Acaccia I apologize that I closed issue #386 before an investigation into the need for an immediate work on compile-time errors. I should have reopened it instead. Let's consider this one for compilation-time error handling.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Status: 📋 Backlog
Development

No branches or pull requests

3 participants