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

try open calls to [] and []= as builtin subscripts first #311

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

metagn
Copy link
Collaborator

@metagn metagn commented Dec 31, 2024

The idea is that untyped templates and generics produce calls to [] for all subscript expressions to capture the overloads of [] in scope at the time. To handle the cases where these subscript expressions are meant as builtin subscripts (e.g. generic instantiations) and not as behavior that any overload of [] would provide, we check for these types of call nodes before triggering overload resolution on the call and try them as builtins.

For clarity and maybe performance, we could give calls to [] and []= produced from untyped subscript expressions different representation, e.g. (atcall (ochoice [] ...) a b c ...) or (call (atchoice [] ...) ...). This would stop things like `[]`(seq, int) from working.

@Araq
Copy link
Member

Araq commented Dec 31, 2024

Why is any of this important when we cannot yet write a binary tree or any program of mild complexity...

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

Successfully merging this pull request may close these issues.

2 participants