KT-820 and KT-824 fixed
This commit is contained in:
@@ -593,7 +593,8 @@ public class Converter {
|
|||||||
if (actualType != null) {
|
if (actualType != null) {
|
||||||
if (isConversionNeeded(actualType, expectedType))
|
if (isConversionNeeded(actualType, expectedType))
|
||||||
conversion += getPrimitiveTypeConversion(expectedType.getCanonicalText());
|
conversion += getPrimitiveTypeConversion(expectedType.getCanonicalText());
|
||||||
if (expression instanceof PsiReferenceExpression && Node.PRIMITIVE_TYPES.contains(actualType.getCanonicalText()) && ((PsiReferenceExpression) expression).isQualified())
|
if (Node.PRIMITIVE_TYPES.contains(actualType.getCanonicalText()) && (expression instanceof PsiReferenceExpression && ((PsiReferenceExpression) expression).isQualified() ||
|
||||||
|
expression instanceof PsiMethodCallExpression))
|
||||||
conversion += ".sure()";
|
conversion += ".sure()";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -651,7 +652,7 @@ public class Converter {
|
|||||||
|
|
||||||
@NotNull
|
@NotNull
|
||||||
public static SureCallChainExpression createSureCallOnlyForChain(PsiExpression expression, PsiType type) {
|
public static SureCallChainExpression createSureCallOnlyForChain(PsiExpression expression, PsiType type) {
|
||||||
String conversion = (expression != null && expression instanceof PsiReferenceExpression && ((PsiReferenceExpression) expression).isQualified()) ?
|
String conversion = (expression != null && (expression instanceof PsiReferenceExpression || expression instanceof PsiMethodCallExpression)) ?
|
||||||
createConversionForExpression(expression, type) : "";
|
createConversionForExpression(expression, type) : "";
|
||||||
return new SureCallChainExpression(expressionToExpression(expression), conversion);
|
return new SureCallChainExpression(expressionToExpression(expression), conversion);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,6 @@
|
|||||||
|
class Test {
|
||||||
|
public static String toFileSystemSafeName(String name) {
|
||||||
|
int size = name.length();
|
||||||
|
return name;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
open class Test() {
|
||||||
|
class object {
|
||||||
|
open public fun toFileSystemSafeName(name : String?) : String? {
|
||||||
|
var size : Int = name?.length().sure()
|
||||||
|
return name
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
package test;
|
||||||
|
import java.io.File;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* User: ignatov
|
||||||
|
*/
|
||||||
|
public class Test {
|
||||||
|
public static boolean isDir(File parent) {
|
||||||
|
if (parent == null || !parent.exists()) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
boolean result = true;
|
||||||
|
if (parent.isDirectory()) {
|
||||||
|
return true;
|
||||||
|
} else
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
namespace test
|
||||||
|
import java.io.File
|
||||||
|
public open class Test() {
|
||||||
|
class object {
|
||||||
|
open public fun isDir(parent : File?) : Boolean {
|
||||||
|
if (((parent == null) || (!parent?.exists())))
|
||||||
|
{
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
var result : Boolean = true
|
||||||
|
if (parent?.isDirectory().sure())
|
||||||
|
{
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
else
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user