Create records from new (IDEA-229796)

GitOrigin-RevId: 38ffe8494d90cb7d5d83c5cfcc923259aac1e05f
This commit is contained in:
Tagir Valeev
2019-12-25 07:43:46 +00:00
committed by intellij-monorepo-bot
parent 3e27e828e6
commit 042c0bff53
22 changed files with 394 additions and 96 deletions
@@ -0,0 +1,9 @@
// "Create record 'MyRecord'" "true"
class Test {
void foo () {
new MyRecord<String> (1, 2);
}
}
public record MyRecord<T>(int i,int i1) {
}
@@ -0,0 +1,9 @@
// "Create record 'MyRecord'" "true"
class Test {
void foo () {
new MyRecord (1, 2);
}
}
public record MyRecord(int i,int i1) {
}
@@ -0,0 +1,6 @@
// "Create record 'MyRecord'" "true"
class Test {
void foo () {
new <caret>MyRecord<String> (1, 2);
}
}
@@ -0,0 +1,6 @@
// "Create record 'MyRecord'" "true"
class Test {
void foo () {
new <caret>MyRecord (1, 2);
}
}
@@ -0,0 +1,9 @@
// "Create inner record 'Foo'" "true"
public class Test {
public static void main() {
new Foo("bar", "baz")
}
private record Foo(String bar,String baz) {
}
}
@@ -0,0 +1,11 @@
// "Create inner record 'Point'" "true"
public class Test {
class Inner {
void test(int x, int y) {
new Point(x, y);
}
}
private record Point(int x,int y) {
}
}
@@ -0,0 +1,6 @@
// "Create inner record 'Foo'" "true"
public class Test {
public static void main() {
new F<caret>oo("bar", "baz")
}
}
@@ -0,0 +1,8 @@
// "Create inner record 'Point'" "true"
public class Test {
class Inner {
void test(int x, int y) {
new Po<caret>int(x, y);
}
}
}