Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 404649 - [1.8][compiler] detect illegal reference to indirect or redundant super
Summary: [1.8][compiler] detect illegal reference to indirect or redundant super
Status: RESOLVED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.8   Edit
Hardware: All All
: P3 enhancement (vote)
Target Milestone: BETA J8   Edit
Assignee: Stephan Herrmann CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 383966
  Show dependency tree
 
Reported: 2013-03-31 11:55 EDT by Stephan Herrmann CLA
Modified: 2013-04-01 17:52 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Stephan Herrmann CLA 2013-03-31 11:55:52 EDT
As of 0.6.2 para 15.12.3 contains this:

" If the method invocation has, before the left parenthesis, the form ClassName TypeName . super . NonWildTypeArgumentsopt Identifier, then:
    [...]
    Otherwise, if the TypeName denotes an interface, let T be the type declaration immediately enclosing the method invocation. A compile-time error occurs if there exists a method, distinct from the compile-time declaration, that overrides (9.4.1) the compile-time declaration from a direct superclass or direct superinterface of T."
    
This rule is yet unimplemented.
Comment 1 Stephan Herrmann CLA 2013-03-31 13:48:05 EDT
At a closer look the quoted snippets from the spec seem to be subsumed in this one from 15.12.1:

"If the form is TypeName . super . NonWildTypeArgumentsopt Identifier, then the name of the method is the Identifier.
 [..]
 Otherwise, TypeName denotes the interface to be searched, I.
 Let T be the type declaration immediately enclosing the method invocation. It is a compile-time error if I is not a direct superinterface of T, or if there exists some other direct superclass or direct superinterface of T, J, such that J is a subtype of I."

At least I fail to see how the situation from 15.12.3 could be created without first triggering the error from 15.12.1.
Comment 2 Stephan Herrmann CLA 2013-03-31 14:23:11 EDT
The first part (regarding 15.12.1) has been pushed to BETA_JAVA8 via commit 86ee968d8acf90a0a75c72085f72a3416b02186d.

Meanwhile I found a test case that should triggers 15.12.3 without triggering 15.12.1. More to still come ...
Comment 3 Stephan Herrmann CLA 2013-03-31 16:59:13 EDT
(In reply to comment #2)
> Meanwhile I found a test case that should triggers 15.12.3 without triggering
> 15.12.1. More to still come ...

Additional test & fix pushed to BETA_JAVA8 via commit 7915a529d4dab8b70a0cdb9189fc342b9112ed8e.
Comment 4 Stephan Herrmann CLA 2013-04-01 17:03:08 EDT
Re-opening for inclusion of similar checks regarding reference expressions (cf. bug 382350 comment 8).
Comment 5 Stephan Herrmann CLA 2013-04-01 17:52:22 EDT
Work for reference expressions has been pushed via commit f28c28de6ed3d2e9e475bca36caf25c219a92533.