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

Checking against signature (the shortcut) should make sure we dispatch to the right method #40

Open
ulysses4ever opened this issue Jan 25, 2024 · 1 comment
Labels
bug Something isn't working p:high

Comments

@ulysses4ever
Copy link
Collaborator

Code in question:

# Step 2a: run type inference with the input type even if abstract
# and party if we're concrete
@debug "is_stable_method: check against signature (2a)"
try
if is_stable_call(func, sig_types)

is_stable_call will call code_typed with an abstract input type (potentially), which can return several results and this is not handled at all: is_stable_call will just take the first CodeInfo:

(_ #=code=#, res_type) = ct[1] # we ought to have just one method body, I think

This is sound for a concrete input type, but the shortcut uses an abstract one. So, is_stable_call should make sure that if there are several results from code_typed, it picks the right one.

@ulysses4ever ulysses4ever added bug Something isn't working p:high labels Jan 25, 2024
@ulysses4ever
Copy link
Collaborator Author

I can't see why it would return several results when called with the signature types of a particular method. Only that method will be returned always, I think? I seem to recall that Jan V convinced me that it's a real issue, but now I can't recall how and why. We can run an experiment, of course. But priority High doesn't seem to be justified.

One idea: can it happen if the methods are unlmbiguous? But then the whole program doesn't make sense...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working p:high
Projects
None yet
Development

No branches or pull requests

1 participant