java: create constructor from usage: ensure parameter type is evaluated before constructor is inserted (IDEA-244902)

otherwise inference may detect overload conflict with existing no-arg constructor

GitOrigin-RevId: bade4409a64e31bd0c7c4d79ffa41222b17a7c8f
This commit is contained in:
Anna Kozlova
2020-07-01 08:27:38 +00:00
committed by intellij-monorepo-bot
parent fab2f3b722
commit 24cb042051
3 changed files with 36 additions and 1 deletions
@@ -0,0 +1,18 @@
// "Create constructor" "true"
class MyTest {
<T> T id(T t) {
return t;
}
{
Foo f = new Foo(id("name"));
}
}
class Foo {
public Foo() {}
public Foo(String name) {
}
}
@@ -0,0 +1,14 @@
// "Create constructor" "true"
class MyTest {
<T> T id(T t) {
return t;
}
{
Foo f = new Foo(i<caret>d("name"));
}
}
class Foo {
public Foo() {}
}