HaxeFoundation / HaxeFoundation/haxe
[jvm] Functional Interfaces not extending proper interface when interface has type parameters
Nobody has claimed this yet.
- Dominant language
- Haxe
- Stars
- 6.9k
- Forks
- 715
- Avg merge
- 2d 2h
- Merged PRs (30d)
- 11
Description
Minimal reproduction
https://github.com/EliteMasterEric/Issue11054/tree/488fbb13733643d5406fbcae42802b07d72652e0
Error Message
No compile error is received, instead Java experiences an error at runtime:
Exception in thread "main" java.lang.ClassCastException: class haxe.root.Main$Closure_main_1 cannot be cast to class test.Robot$GreetRobot (haxe.root.Main$Closure_main_1 and test.Robot$GreetRobot are in unnamed module of loader 'app')
at test.RobotFactory$2.performTask(RobotFactory.java:28)
at haxe.root.Main.main(src/Main.hx:16)
at haxe.root.Main.main(src/Main.hx:1)
Notes
This is a similar case to #11054, which occurs in Haxe 5c05e6d. Since the main test case of #11054 is resolved, this is not a regression, so I am making a new issue for ease of tracking.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the linked minimal reproduction and the generated Java files, especially RobotFactory.java and the test.Robot.GreetRobot interface involved in the runtime exception. Compare the generated functional-interface handling for the type-parameter case with the working #11054 case. Done means the reproduction runs without the reported ClassCastException and the generated interface relationship is correct.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- compilers
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100