Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 343079 - [compiler] internal compiler error when trying to invoke an abstract method as tsuper
Summary: [compiler] internal compiler error when trying to invoke an abstract method a...
Status: VERIFIED FIXED
Alias: None
Product: Objectteams
Classification: Tools
Component: OTJ (show other bugs)
Version: 0.8   Edit
Hardware: Other Linux
: P3 normal (vote)
Target Milestone: 0.8 M7   Edit
Assignee: Stephan Herrmann CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-04-17 17:45 EDT by Stephan Herrmann CLA
Modified: 2011-04-28 14:49 EDT (History)
0 users

See Also:


Attachments
test & proposed fix (2.90 KB, patch)
2011-04-17 17:49 EDT, Stephan Herrmann CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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