mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-10 13:17:09 +07:00
fix to switch intersection types order in casts when one of the last types is not an interface
This commit is contained in:
+11
@@ -0,0 +1,11 @@
|
||||
import java.io.Serializable;
|
||||
|
||||
public class FooBar1 {
|
||||
{
|
||||
Object x = null;
|
||||
Object y = (CharSequence & Serializable) x;
|
||||
Object y2 = (CharSequence & Integer) x;
|
||||
Object y3 = (Integer & CharSequence) x;
|
||||
<error descr="Incompatible types. Found: 'java.lang.CharSequence & java.io.Serializable', required: 'int'">int y1 = (CharSequence & Serializable) x;</error>
|
||||
}
|
||||
}
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
// "Move 'Number' to the beginning" "true"
|
||||
class C {
|
||||
{
|
||||
Object x = null;
|
||||
Object y2 = (Number & CharSequence) x;
|
||||
}
|
||||
}
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
// "Move 'Number' to the beginning" "true"
|
||||
class C {
|
||||
{
|
||||
Object x = null;
|
||||
Object y2 = (CharSequence & Num<caret>ber) x;
|
||||
}
|
||||
}
|
||||
+28
@@ -0,0 +1,28 @@
|
||||
/*
|
||||
* Copyright 2000-2013 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package com.intellij.codeInsight.daemon.quickFix;
|
||||
|
||||
public class FlipIntersectionTypesTest extends LightQuickFixTestCase {
|
||||
public void test() throws Exception {
|
||||
doAllTests();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getBasePath() {
|
||||
return "/codeInsight/daemonCodeAnalyzer/quickFix/flipIntersection";
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user