Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 343079

Summary: [compiler] internal compiler error when trying to invoke an abstract method as tsuper
Product: [Tools] Objectteams Reporter: Stephan Herrmann <stephan.herrmann>
Component: OTJAssignee: Stephan Herrmann <stephan.herrmann>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: P3    
Version: 0.8   
Target Milestone: 0.8 M7   
Hardware: Other   
OS: Linux   
Whiteboard:
Attachments:
Description Flags
test & proposed fix none

Description Stephan Herrmann CLA 2011-04-17 17:45:05 EDT
Given these teams:

public team class Team139ita7_1 {
    public abstract class R {
        abstract void rm();
    }
}

public team class Team139ita7_2 extends Team139ita7_1 {
    @Override
    public class R {
        @Override
        void rm() {
            tsuper.rm();
        }
    }
}

the compiler throws ICE:

cannot find real method binding for tsuper call!
	at org.eclipse.objectteams.otdt.internal.core.compiler.ast.TSuperMessageSend.generateCode(TSuperMessageSend.java:186)
	at org.eclipse.jdt.internal.compiler.ast.Statement.generateArguments(Statement.java:215)
	at org.eclipse.jdt.internal.compiler.ast.MessageSend.generateCode(MessageSend.java:321)
	at org.eclipse.jdt.internal.compiler.ast.Expression.generateCode(Expression.java:775)
	at org.eclipse.jdt.internal.compiler.ast.AbstractMethodDeclaration.generateCode(AbstractMethodDeclaration.java:470)
	at org.eclipse.jdt.internal.compiler.ast.AbstractMethodDeclaration.generateCode(AbstractMethodDeclaration.java:371)
	at org.eclipse.jdt.internal.compiler.ast.TypeDeclaration.generateCode(TypeDeclaration.java:996)
Comment 1 Stephan Herrmann CLA 2011-04-17 17:49:28 EDT
Created attachment 193444 [details]
test & proposed fix

The same test as in comment 0 and a fix: detect the situation as an
illegal direct call to an abstract method - thus avoiding the call to
generateCode on this tsuper call, which is where we bailed out previously.
Comment 2 Stephan Herrmann CLA 2011-04-17 17:51:55 EDT
Patch committed as r1441,2.
Comment 3 Stephan Herrmann CLA 2011-04-28 14:49:58 EDT
Verified for 0.8M7 using build 201104261158