| Summary: | [compiler] better reporting for unresolvable tsuper call | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| Product: | [Tools] Objectteams | Reporter: | Stephan Herrmann <stephan.herrmann> | ||||||
| Component: | OTJ | Assignee: | Stephan Herrmann <stephan.herrmann> | ||||||
| Status: | VERIFIED FIXED | QA Contact: | |||||||
| Severity: | normal | ||||||||
| Priority: | P3 | ||||||||
| Version: | 0.8 | ||||||||
| Target Milestone: | 0.8 M4 | ||||||||
| Hardware: | Other | ||||||||
| OS: | Linux | ||||||||
| Whiteboard: | |||||||||
| Attachments: |
|
||||||||
|
Description
Stephan Herrmann
Created attachment 184544 [details]
fix by changed strategy
It turned out that the old strategy of adding the tsuper marker arg
already in the AST complicates issues like error reporting.
Therefor I changed the strategy as to add the marker arg only during
code gen. This obviously entailed several follow-up changes in areas
like ASTConverter and code selection.
Some details of this change:
- directly search method in the designated tsuper role
(requires new hook in MessageSend.resolveType(..))
- also canBeSeenBy operates directly on the target method binding
and needs to respect the privilege of tsuper calls (if combined
with explicit super access)
- store the real target method in TSuperMessageSend.binding
- find the copied method only for codeGen and directly add the
marker arg (casted null) to the codeStream.
This simplifies ProblemReporter.invalidMethod(..) because no
synthetic arg needs to be hidden any more.
This also includes some fixes regarding tsuper precedence
(see test TeamNesting.test1110_fullInheritanceStructure5[a]).
Indludes one new disabled test
AcquisitionAnd....test139_tsuperCallWithTypeParameter1()
which requires ParameterizedMethodBinding of a copyInheritanceSrc.
Patch has been committed as r1122 f. (In reply to comment #0) > Additionally, if the enclosing method is a callin method an NPE may occur. Forgot to mention: this NPE happened because the ProblemReporter was tweaking the details of a ProblemMethodBinding, which is no longer needed. Created attachment 184552 [details]
follow-up changes
This patch contains follow-up changes:
- revert an OT-patch in MethodLocator, methodBinding is alread the tsuper
method now, don't navigate copyInheritanceSrc.
(was regression in otdt...RenameVirtualMethodInClassTests)
- consistently hide the codegenBinding from clients like dom.
Verified for M4 using build 201012150343 However, a FUP has been filed as bug 332790. |