Bug 400763 - [compiler] weird behavior in shadowing scenario.
Summary: [compiler] weird behavior in shadowing scenario.
Status: NEW
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 4.3   Edit
Hardware: PC Windows 7
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: JDT-Core-Inbox CLA
QA Contact:
URL:
Whiteboard: stalebug
Keywords:
Depends on:
Blocks:
 
Reported: 2013-02-14 02:26 EST by Srikanth Sankaran CLA
Modified: 2023-03-18 12:19 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Srikanth Sankaran CLA 2013-02-14 02:26:26 EST
Master:

The following program should compile but doesn't:

interface I {
	void foo();
}

public class X {
	<M> void foo() {
	
		class M { int f;};  // rightly complain that M is hiding <M>

		new X() {
			void foo() {
				new M().f = 10;  // but then treat this M as <M> and complain M cannot be instantiated and that there is no field f
			}
		};
	}
}
  
Inside the anonymous class we bind M to <M> instead of the class M.
Comment 1 Eclipse Genie CLA 2019-03-29 11:34:58 EDT
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.
Comment 2 Stephan Herrmann CLA 2019-04-02 12:43:16 EDT
Still relevant in 4.11
Comment 3 Eclipse Genie CLA 2021-03-23 18:39:35 EDT
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.
Comment 4 Eclipse Genie CLA 2023-03-18 12:19:21 EDT
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.