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

Support reified generics for runtime type checking #28

Open
WillBAnders opened this issue Jun 18, 2023 · 0 comments
Open

Support reified generics for runtime type checking #28

WillBAnders opened this issue Jun 18, 2023 · 0 comments

Comments

@WillBAnders
Copy link
Contributor

Following 04b3b94, runtime types should now force type erasure. This prevents many of the evaluators runtime checks from being meaningful, most notably with Struct properties (since existence is tied to the type).

Reified generics appear to be the best solution for this, which will likely require adding an invocation context to functions for storing runtime generic bindings. This context can also be used for storing the evaluator instance (rather than using a global variable) as well as debug information for errors in native functions with #3.

@WillBAnders WillBAnders self-assigned this Jun 18, 2023
WillBAnders added a commit that referenced this issue Sep 17, 2023
)

This replaces Context.arguments with Context.generics, since the only use of
arguments was to extract runtime generic types for constructing return values.
These generics are computed following the same rules as Scope resolution, but
using runtime types. Consequently, the type checking peformed when invoking
native functions should now validate generic relations as well (this is more of
an improvement as part of reified generics than an outright fix, but a key step
towards safety here).

Note that runtime times are still lacking as the Evaluator itself is using type
erasure; this only fixes the handling for the standard library.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant