mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-04-17 20:11:25 +07:00
[java-intentions] Quick-fixes to change method/var return type when inference fails
Fixes IDEA-354184 Quick-fix for generic types GitOrigin-RevId: 65d513f5303a082c26283e09275470840df90d30
This commit is contained in:
committed by
intellij-monorepo-bot
parent
9f5cf87b91
commit
78d4bd2c8b
@@ -0,0 +1,12 @@
|
||||
// "Make 'getList()' return 'A.Box<java.util.List<java.lang.String>>' or ancestor" "true-preview"
|
||||
import java.util.*;
|
||||
|
||||
public class A {
|
||||
Box<List<String>> getList() {
|
||||
return new Box<>(Arrays.asList("foo"));
|
||||
}
|
||||
|
||||
class Box<T> {
|
||||
Box(T value) {}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
// "Make 'getList()' return 'A.Box<java.util.List<java.lang.String>>' or ancestor" "true-preview"
|
||||
import java.util.*;
|
||||
|
||||
public class A {
|
||||
Box<Set<String>> getList() {
|
||||
return new <caret>Box<>(Arrays.asList("foo"));
|
||||
}
|
||||
|
||||
class Box<T> {
|
||||
Box(T value) {}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
// "Change variable 'box' type to 'A.Box<List<String>>'" "true-preview"
|
||||
import java.util.*;
|
||||
|
||||
public class A {
|
||||
void test() {
|
||||
Box<List<String>> box = new Box<>(Arrays.asList("foo"));
|
||||
}
|
||||
|
||||
class Box<T> {
|
||||
Box(T value) {}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
// "Change variable 'box' type to 'A.Box<List<String>>'" "true-preview"
|
||||
import java.util.*;
|
||||
|
||||
public class A {
|
||||
void test() {
|
||||
Box<Set<String>> box = new <caret>Box<>(Arrays.asList("foo"));
|
||||
}
|
||||
|
||||
class Box<T> {
|
||||
Box(T value) {}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user