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

add a todo function when running type check #1173

Open
johnynek opened this issue Mar 17, 2024 · 0 comments
Open

add a todo function when running type check #1173

johnynek opened this issue Mar 17, 2024 · 0 comments

Comments

@johnynek
Copy link
Owner

when working on #1171 I found a pattern which was useful:

external def todo(ignore: x) -> forall a. a

this function can consume arguments to make them look used, and then return anything. Of course, you can't have a function like that at runtime.

On way to avoid that is to only add that function to predef when in type-check mode. In that case, we never even emit anything, any so it can't be unsafe. This could also be used by a language server in the IDE, since you don't need the compiled outputs in that case either.

If we had a resident server that could cache memory, we could keep a cache of compiled packages for dependencies but only use it for type-checking (or rather, the cache key can depend on if we are in type check mode or not).

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

No branches or pull requests

1 participant