Bug 427719 - [1.8][compiler] javac reports ambiguity eclipse does not
Summary: [1.8][compiler] javac reports ambiguity eclipse does not
Status: REOPENED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 4.4   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: 404648
  Show dependency tree
 
Reported: 2014-02-08 01:28 EST by Manoj N Palat CLA
Modified: 2024-02-29 15:15 EST (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 Manoj N Palat CLA 2014-02-08 01:28:56 EST
AmbigousMethodTest#test051 (and test053, and test074)

test051 reproduced below:
interface I<T> {
}
class Y {
  void bar(I<?> x) {
  }
}
public class X extends Y {
  void foo() {
    bar(new Z(){});
  }
  void bar(Z x) {
  }
  private static class Z implements I {
  }
}


Specifically in 1.8; reports the error for <1.8
Comment 1 Stephan Herrmann CLA 2014-02-08 07:00:51 EST
Exactly, these three tests show that our use of TB.isCompatibleWith is not strict enough in some situations. IIRC fine tuning TB.sIsMoreSpecific can restore the expected errors. The difficulty is only in finding the right implementation that does not cause (too many) regressions elsewhere.

We need a strict test for subtyping to start with. From there it might be necessary to soften the tests for certain under-specified corner cases. One such grey zone appears to be the relations between types T#RAW and T<?>, another one the relation between T<?> and T<?>.
Comment 2 Srikanth Sankaran CLA 2014-02-09 06:12:21 EST
(In reply to Stephan Herrmann from comment #1)
> Exactly, these three tests show that our use of TB.isCompatibleWith is not
> strict enough in some situations. IIRC fine tuning TB.sIsMoreSpecific can
> restore the expected errors. The difficulty is only in finding the right
> implementation that does not cause (too many) regressions elsewhere.

Stephan, may we should try a direct implementation of 4.10.1, 4.10.2 and
4.10.3.
Comment 3 Manoj N Palat CLA 2014-02-13 01:35:45 EST
GenericTypeTest#test1234
public class X { 
	void a3(G x) {} 
	<T extends F<X>> void a3(T x) {}

	public static void ambiguousCases() { 
		H<X> hx = null;
		H hraw = null;
		new X().a3(hx);//javac reports ambiguous eclipse does not
		new X().a3(hraw);// javac reports ambiguous eclipse does not
	} 
}
class F<T1> {}  
class G<T2> extends F<T2> {}
class H<T3> extends G<T3> {}
Comment 4 Manoj N Palat CLA 2015-04-19 23:53:14 EDT
Moving out of Mars
Comment 5 Manoj N Palat CLA 2016-04-05 00:15:36 EDT
Moving out of 4.6 - target to be set later
Comment 6 Eclipse Genie CLA 2020-03-19 14:23:03 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. As such, we're closing this bug.

If you have further information on the current state of the bug, please add it and reopen this bug. 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 7 Stephan Herrmann CLA 2020-03-19 15:02:00 EDT
this needs to be resolved
Comment 8 Eclipse Genie CLA 2022-03-10 16:44:41 EST
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 9 Eclipse Genie CLA 2024-02-29 15:15:23 EST
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.