!is supported in data flow info for ifs
This commit is contained in:
@@ -1570,7 +1570,7 @@ public class JetTypeInferrer {
|
|||||||
condition.accept(new JetVisitor() {
|
condition.accept(new JetVisitor() {
|
||||||
@Override
|
@Override
|
||||||
public void visitIsExpression(JetIsExpression expression) {
|
public void visitIsExpression(JetIsExpression expression) {
|
||||||
if (conditionValue) {
|
if (conditionValue && !expression.isNegated() || !conditionValue && expression.isNegated()) {
|
||||||
JetPattern pattern = expression.getPattern();
|
JetPattern pattern = expression.getPattern();
|
||||||
result[0] = patternsToDataFlowInfo.get(pattern);
|
result[0] = patternsToDataFlowInfo.get(pattern);
|
||||||
if (scopeToExtend != null) {
|
if (scopeToExtend != null) {
|
||||||
|
|||||||
@@ -147,3 +147,9 @@ fun f15(a : A?) {
|
|||||||
<info descr="Automatically cast to B">a</info>.bar()
|
<info descr="Automatically cast to B">a</info>.bar()
|
||||||
<error>c</error>.bar()
|
<error>c</error>.bar()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fun getStringLength(obj : Any) : Char? {
|
||||||
|
if (obj !is String)
|
||||||
|
return null
|
||||||
|
return <info>obj</info>.get(0) // no cast to String is needed
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user