KT-820 and KT-824 fixed

This commit is contained in:
Sergey Ignatov
2011-12-14 14:06:22 +04:00
parent 96aced06ee
commit d621b73b04
5 changed files with 54 additions and 2 deletions
+3 -2
View File
@@ -593,7 +593,8 @@ public class Converter {
if (actualType != null) {
if (isConversionNeeded(actualType, expectedType))
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()";
}
}
@@ -651,7 +652,7 @@ public class Converter {
@NotNull
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) : "";
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
}
}
}
+18
View File
@@ -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;
}
}
+19
View File
@@ -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
}
}
}