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

Completion vs. overloads (or something) #11549

Open
Simn opened this issue Feb 5, 2024 · 2 comments
Open

Completion vs. overloads (or something) #11549

Simn opened this issue Feb 5, 2024 · 2 comments
Assignees

Comments

@Simn
Copy link
Member

Simn commented Feb 5, 2024

Modified from #11236 (comment):

import java.util.concurrent.Executors;
import java.util.concurrent.TimeUnit;
import java.lang.Runnable;

final exec = Executors.newSingleThreadScheduledExecutor();

function schedule(f:() -> Void)
	exec.schedule(f, 0, TimeUnit.MILLISECONDS);

function greeter():Void {
	trace("hello");
	exec.shutdown();
}

function main() {
	schedule(greeter);

	exec.
}

This doesn't give any completion. Adding @:debug.display shows that it just randomly ends:

before processing:
 339- 370 EBlock
 342- 359   ECall
 342- 350     schedule
 351- 358     greeter
 367- 368   EDisplay DKDot
 363- 367     exec

after processing:
 339- 370 EBlock
 342- 359   ECall
 342- 350     schedule
 351- 358     greeter
 367- 368   EDisplay DKDot
 363- 367     exec

Probably related to the exec.schedule call because using cast f there makes it work.

@Simn Simn self-assigned this Feb 7, 2024
@Simn
Copy link
Member Author

Simn commented Feb 7, 2024

I think this is a cache-problem with ctx.g.functional_interface_lut not being populated when modules are restored from the cache.

@Simn
Copy link
Member Author

Simn commented Feb 7, 2024

I'll fix this on #11544 because that's easier.

A test would be good, too.

Simn added a commit that referenced this issue Feb 8, 2024
* [jvm] rework functional interface unification again

see #11390

* add test

see #11236

* lazily check functional interface lut if there's no value

see #11549
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