mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-01-09 16:39:37 +07:00
erasure type of new expression if diamonds were used and during applicability check unchecked conversion was applied (IDEA-154009)
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
class Test {
|
||||
{
|
||||
Holder h = null;
|
||||
Result<String> r1 = new Result<><error descr="'Result(D)' in 'Result' cannot be applied to '(Holder)'">(h)</error>;
|
||||
Result<String> r2 = Result.create<error descr="'create(K)' in 'Result' cannot be applied to '(Holder)'">(h)</error>;
|
||||
|
||||
Holder dataHolder = null;
|
||||
Result<String> r3 = new Result<>(new Holder<>(dataHolder));
|
||||
Result<String> r4 = Result.create(new Holder<>(dataHolder));
|
||||
|
||||
Result<String> r5 = new Result<>(Holder.create(dataHolder));
|
||||
Result<String> r6 = Result.create(Holder.create(dataHolder));
|
||||
|
||||
}
|
||||
}
|
||||
class Result<D> {
|
||||
Result(D data) {}
|
||||
|
||||
static <K> Result<K> create(K k) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
class Holder<E> {
|
||||
Holder(Holder<E> holder) {}
|
||||
|
||||
static <M> Holder<M> create(Holder<M> m) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user