Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
硅谷海盗
kotlin
提交
5e150d62
K
kotlin
项目概览
硅谷海盗
/
kotlin
与 Fork 源项目一致
从无法访问的项目Fork
通知
2
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
K
kotlin
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
5e150d62
编写于
2月 01, 2021
作者:
J
Jinseong Jeon
提交者:
Dmitriy Novozhilov
2月 10, 2021
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
FIR checker: differentiate UNSAFE_IMPLICIT_INVOKE_CALL from UNSAFE_CALL
上级
0c0c53cc
变更
21
隐藏空白更改
内联
并排
Showing
21 changed file
with
73 addition
and
106 deletion
+73
-106
compiler/fir/checkers/checkers-component-generator/src/org/jetbrains/kotlin/fir/checkers/generator/diagnostics/FirDiagnosticsList.kt
.../fir/checkers/generator/diagnostics/FirDiagnosticsList.kt
+3
-7
compiler/fir/checkers/gen/org/jetbrains/kotlin/fir/analysis/diagnostics/FirErrors.kt
...rg/jetbrains/kotlin/fir/analysis/diagnostics/FirErrors.kt
+1
-0
compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/checkers/declaration/FirDestructuringDeclarationChecker.kt
...heckers/declaration/FirDestructuringDeclarationChecker.kt
+1
-1
compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/diagnostics/FirDefaultErrorMessages.kt
...otlin/fir/analysis/diagnostics/FirDefaultErrorMessages.kt
+6
-5
compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/diagnostics/coneDiagnosticToFirDiagnostic.kt
...fir/analysis/diagnostics/coneDiagnosticToFirDiagnostic.kt
+7
-8
compiler/fir/dump/src/org/jetbrains/kotlin/fir/dump/HtmlFirDump.kt
...fir/dump/src/org/jetbrains/kotlin/fir/dump/HtmlFirDump.kt
+2
-2
compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/calls/tower/FirInvokeResolveTowerExtension.kt
...fir/resolve/calls/tower/FirInvokeResolveTowerExtension.kt
+3
-2
compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/diagnostics/FirDiagnostics.kt
...etbrains/kotlin/fir/resolve/diagnostics/FirDiagnostics.kt
+3
-12
compiler/testData/diagnostics/tests/extensions/kt1875.fir.kt
compiler/testData/diagnostics/tests/extensions/kt1875.fir.kt
+2
-2
compiler/testData/diagnostics/tests/platformTypes/nullabilityWarnings/invoke.fir.kt
...ics/tests/platformTypes/nullabilityWarnings/invoke.fir.kt
+0
-23
compiler/testData/diagnostics/tests/platformTypes/nullabilityWarnings/invoke.kt
...nostics/tests/platformTypes/nullabilityWarnings/invoke.kt
+1
-0
compiler/testData/diagnostics/tests/resolve/invoke/errors/unsafeCallWithInvoke.fir.kt
...s/tests/resolve/invoke/errors/unsafeCallWithInvoke.fir.kt
+2
-2
compiler/testData/diagnostics/tests/resolve/invoke/invokeAndSmartCast.fir.kt
...iagnostics/tests/resolve/invoke/invokeAndSmartCast.fir.kt
+2
-2
compiler/testData/diagnostics/tests/resolve/invoke/kt30695_2.fir.kt
...estData/diagnostics/tests/resolve/invoke/kt30695_2.fir.kt
+4
-4
compiler/testData/diagnostics/tests/safeCall.fir.kt
compiler/testData/diagnostics/tests/safeCall.fir.kt
+2
-2
compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/1.fir.kt
...ests-spec/testData/diagnostics/notLinked/dfa/neg/1.fir.kt
+14
-14
compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/2.fir.kt
...ests-spec/testData/diagnostics/notLinked/dfa/pos/2.fir.kt
+4
-4
compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/6.fir.kt
...ests-spec/testData/diagnostics/notLinked/dfa/pos/6.fir.kt
+9
-9
compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/7.fir.kt
...ests-spec/testData/diagnostics/notLinked/dfa/pos/7.fir.kt
+5
-5
idea/idea-frontend-fir/src/org/jetbrains/kotlin/idea/fir/FirUtils.kt
...rontend-fir/src/org/jetbrains/kotlin/idea/fir/FirUtils.kt
+1
-1
idea/idea-frontend-fir/src/org/jetbrains/kotlin/idea/references/FirReferenceResolveHelper.kt
...rains/kotlin/idea/references/FirReferenceResolveHelper.kt
+1
-1
未找到文件。
compiler/fir/checkers/checkers-component-generator/src/org/jetbrains/kotlin/fir/checkers/generator/diagnostics/FirDiagnosticsList.kt
浏览文件 @
5e150d62
...
...
@@ -218,7 +218,6 @@ val DIAGNOSTICS_LIST = DiagnosticListBuilder.buildDiagnosticList {
parameter
<
Name
>(
"containingClassName"
)
}
val
OVERRIDING_FINAL_MEMBER
by
error
<
FirSourceElement
,
KtNamedDeclaration
>(
PositioningStrategy
.
OVERRIDE_MODIFIER
)
{
parameter
<
FirCallableDeclaration
<
*
>>(
"overriddenDeclaration"
)
parameter
<
Name
>(
"containingClassName"
)
...
...
@@ -240,7 +239,6 @@ val DIAGNOSTICS_LIST = DiagnosticListBuilder.buildDiagnosticList {
parameter
<
FirMemberDeclaration
>(
"overridingDeclaration"
)
parameter
<
FirMemberDeclaration
>(
"overriddenDeclaration"
)
}
}
group
(
"Redeclarations"
)
{
...
...
@@ -282,13 +280,11 @@ val DIAGNOSTICS_LIST = DiagnosticListBuilder.buildDiagnosticList {
parameter
<
FirMemberDeclaration
>(
"function"
)
}
val
FUNCTION_DECLARATION_WITH_NO_NAME
by
error
<
FirSourceElement
,
KtFunction
>(
PositioningStrategy
.
DECLARATION_SIGNATURE
)
// TODO: val ANONYMOUS_FUNCTION_WITH_NAME by error1<FirSourceElement, PsiElement, Name>(SourceElementPositioningStrategies.DECLARATION_NAME)
val
ANONYMOUS_FUNCTION_PARAMETER_WITH_DEFAULT_VALUE
by
error
<
FirSourceElement
,
KtParameter
>(
PositioningStrategy
.
PARAMETER_DEFAULT_VALUE
)
val
USELESS_VARARG_ON_PARAMETER
by
warning
<
FirSourceElement
,
KtParameter
>()
}
group
(
"Properties & accessors"
)
{
...
...
@@ -324,7 +320,6 @@ val DIAGNOSTICS_LIST = DiagnosticListBuilder.buildDiagnosticList {
val
EXPECTED_DELEGATED_PROPERTY
by
error
<
FirSourceElement
,
KtPropertyDelegate
>()
}
group
(
"Destructuring declaration"
)
{
val
INITIALIZER_REQUIRED_FOR_DESTRUCTURING_DECLARATION
by
error
<
FirSourceElement
,
KtDestructuringDeclaration
>()
val
COMPONENT_FUNCTION_MISSING
by
error
<
FirSourceElement
,
PsiElement
>
{
...
...
@@ -340,7 +335,6 @@ val DIAGNOSTICS_LIST = DiagnosticListBuilder.buildDiagnosticList {
parameter
<
Name
>(
"componentFunctionName"
)
}
// TODO: val COMPONENT_FUNCTION_ON_NULLABLE by ...
// TODO: val COMPONENT_FUNCTION_RETURN_TYPE_MISMATCH by ...
}
...
...
@@ -363,7 +357,9 @@ val DIAGNOSTICS_LIST = DiagnosticListBuilder.buildDiagnosticList {
val
UNSAFE_CALL
by
error
<
FirSourceElement
,
PsiElement
>(
PositioningStrategy
.
DOT_BY_SELECTOR
)
{
parameter
<
ConeKotlinType
>(
"receiverType"
)
}
// TODO: val UNSAFE_IMPLICIT_INVOKE_CALL by error1<FirSourceElement, PsiElement, ConeKotlinType>()
val
UNSAFE_IMPLICIT_INVOKE_CALL
by
error
<
FirSourceElement
,
PsiElement
>()
{
parameter
<
ConeKotlinType
>(
"receiverType"
)
}
// TODO: val UNSAFE_INFIX_CALL by ...
// TODO: val UNSAFE_OPERATOR_CALL by ...
// TODO: val UNEXPECTED_SAFE_CALL by ...
...
...
compiler/fir/checkers/gen/org/jetbrains/kotlin/fir/analysis/diagnostics/FirErrors.kt
浏览文件 @
5e150d62
...
...
@@ -230,6 +230,7 @@ object FirErrors {
// Nullability
val
UNSAFE_CALL
by
error1
<
FirSourceElement
,
PsiElement
,
ConeKotlinType
>(
SourceElementPositioningStrategies
.
DOT_BY_SELECTOR
)
val
UNSAFE_IMPLICIT_INVOKE_CALL
by
error1
<
FirSourceElement
,
PsiElement
,
ConeKotlinType
>()
// When expressions
val
NO_ELSE_IN_WHEN
by
error1
<
FirSourceElement
,
KtWhenExpression
,
List
<
WhenMissingCase
>>(
SourceElementPositioningStrategies
.
WHEN_EXPRESSION
)
...
...
compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/checkers/declaration/FirDestructuringDeclarationChecker.kt
浏览文件 @
5e150d62
...
...
@@ -101,7 +101,7 @@ object FirDestructuringDeclarationChecker : FirPropertyChecker() {
reporter
.
report
(
FirErrors
.
COMPONENT_FUNCTION_ON_NULLABLE
.
on
(
originalDestructuringDeclarationOrInitializerSource
,
(
diagnostic
.
candidate
S
ymbol
.
fir
as
FirSimpleFunction
).
name
(
diagnostic
.
candidate
.
s
ymbol
.
fir
as
FirSimpleFunction
).
name
),
context
)
...
...
compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/diagnostics/FirDefaultErrorMessages.kt
浏览文件 @
5e150d62
...
...
@@ -157,6 +157,7 @@ import org.jetbrains.kotlin.fir.analysis.diagnostics.FirErrors.UNINITIALIZED_VAR
import
org.jetbrains.kotlin.fir.analysis.diagnostics.FirErrors.UNRESOLVED_LABEL
import
org.jetbrains.kotlin.fir.analysis.diagnostics.FirErrors.UNRESOLVED_REFERENCE
import
org.jetbrains.kotlin.fir.analysis.diagnostics.FirErrors.UNSAFE_CALL
import
org.jetbrains.kotlin.fir.analysis.diagnostics.FirErrors.UNSAFE_IMPLICIT_INVOKE_CALL
import
org.jetbrains.kotlin.fir.analysis.diagnostics.FirErrors.UNUSED_VARIABLE
import
org.jetbrains.kotlin.fir.analysis.diagnostics.FirErrors.UPPER_BOUND_VIOLATED
import
org.jetbrains.kotlin.fir.analysis.diagnostics.FirErrors.USELESS_VARARG_ON_PARAMETER
...
...
@@ -506,11 +507,11 @@ class FirDefaultErrorMessages : DefaultErrorMessages.Extension {
"Only safe (?.) or non-null asserted (!!.) calls are allowed on a nullable receiver of type {0}"
,
RENDER_TYPE
)
//
map.put(
//
UNSAFE_IMPLICIT_INVOKE_CALL,
//
"Reference has a nullable type ''{0}'', use explicit \"?.invoke\" to make a function-like call instead.",
//
RENDER_TYPE
//
)
map
.
put
(
UNSAFE_IMPLICIT_INVOKE_CALL
,
"Reference has a nullable type ''{0}'', use explicit \"?.invoke\" to make a function-like call instead."
,
RENDER_TYPE
)
// When expressions
map
.
put
(
NO_ELSE_IN_WHEN
,
"''when'' expression must be exhaustive, add necessary {0}"
,
WHEN_MISSING_CASES
)
...
...
compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/diagnostics/coneDiagnosticToFirDiagnostic.kt
浏览文件 @
5e150d62
...
...
@@ -58,20 +58,19 @@ private fun mapInapplicableCandidateError(
source
:
FirSourceElement
,
):
FirDiagnostic
<
*
>
{
// TODO: Need to distinguish SMARTCAST_IMPOSSIBLE
// TODO: handle other UNSAFE_* variants: in
voke, in
fix, operator
val
rootCause
=
diagnostic
.
diagnostics
.
find
{
it
.
applicability
==
diagnostic
.
applicability
}
// TODO: handle other UNSAFE_* variants: infix, operator
val
rootCause
=
diagnostic
.
candidate
.
diagnostics
.
find
{
it
.
applicability
==
diagnostic
.
applicability
}
if
(
rootCause
!=
null
&&
rootCause
is
InapplicableWrongReceiver
&&
rootCause
.
actualType
?.
isNullable
==
true
&&
(
rootCause
.
expectedType
==
null
||
!
rootCause
.
expectedType
!!
.
isMarkedNullable
)
(
rootCause
.
expectedType
==
null
||
rootCause
.
expectedType
!!
.
isEffectivelyNotNull
()
)
)
{
val
expectedType
=
rootCause
.
expectedType
if
(
expectedType
==
null
||
expectedType
.
isEffectivelyNotNull
())
{
return
FirErrors
.
UNSAFE_CALL
.
on
(
source
,
rootCause
.
actualType
!!
)
if
(
diagnostic
.
candidate
.
callInfo
.
isImplicitInvoke
)
{
return
FirErrors
.
UNSAFE_IMPLICIT_INVOKE_CALL
.
on
(
source
,
rootCause
.
actualType
!!
)
}
return
FirErrors
.
UNSAFE_CALL
.
on
(
source
,
rootCause
.
actualType
!!
)
}
return
FirErrors
.
INAPPLICABLE_CANDIDATE
.
on
(
source
,
diagnostic
.
candidate
S
ymbol
)
return
FirErrors
.
INAPPLICABLE_CANDIDATE
.
on
(
source
,
diagnostic
.
candidate
.
s
ymbol
)
}
private
fun
ConeSimpleDiagnostic
.
getFactory
():
FirDiagnosticFactory0
<
FirSourceElement
,
*
>
{
...
...
compiler/fir/dump/src/org/jetbrains/kotlin/fir/dump/HtmlFirDump.kt
浏览文件 @
5e150d62
...
...
@@ -1231,9 +1231,9 @@ class HtmlFirDump internal constructor(private var linkResolver: FirLinkResolver
private
fun
FlowContent
.
generate
(
diagnostic
:
ConeDiagnostic
)
{
when
(
diagnostic
)
{
is
ConeInapplicableCandidateError
->
{
describeVerbose
(
diagnostic
.
candidate
S
ymbol
)
describeVerbose
(
diagnostic
.
candidate
.
s
ymbol
)
br
diagnostic
.
errors
.
forEach
{
callDiagnostic
->
diagnostic
.
candidate
.
system
.
errors
.
forEach
{
callDiagnostic
->
when
(
callDiagnostic
)
{
is
NewConstraintError
->
{
ident
()
...
...
compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/calls/tower/FirInvokeResolveTowerExtension.kt
浏览文件 @
5e150d62
...
...
@@ -5,7 +5,6 @@
package
org.jetbrains.kotlin.fir.resolve.calls.tower
import
org.jetbrains.kotlin.fir.declarations.FirRegularClass
import
org.jetbrains.kotlin.fir.expressions.FirExpression
import
org.jetbrains.kotlin.fir.expressions.FirResolvedQualifier
import
org.jetbrains.kotlin.fir.expressions.builder.FirQualifiedAccessExpressionBuilder
...
...
@@ -156,7 +155,9 @@ internal class FirInvokeResolveTowerExtension(
val
invokeFunctionInfo
=
info
.
copy
(
explicitReceiver
=
invokeReceiverExpression
,
name
=
OperatorNameConventions
.
INVOKE
,
explicitReceiver
=
invokeReceiverExpression
,
name
=
OperatorNameConventions
.
INVOKE
,
isImplicitInvoke
=
true
,
candidateForCommonInvokeReceiver
=
invokeReceiverCandidate
.
takeUnless
{
invokeBuiltinExtensionMode
}
).
let
{
when
{
...
...
compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/diagnostics/FirDiagnostics.kt
浏览文件 @
5e150d62
...
...
@@ -38,20 +38,11 @@ class ConeHiddenCandidateError(
override
val
reason
:
String
get
()
=
"HIDDEN: ${describeSymbol(candidateSymbol)} is invisible"
}
class
ConeInapplicableCandidateError
private
constructor
(
class
ConeInapplicableCandidateError
(
val
applicability
:
CandidateApplicability
,
val
candidateSymbol
:
AbstractFirBasedSymbol
<
*
>,
val
diagnostics
:
List
<
ResolutionDiagnostic
>,
val
errors
:
List
<
ConstraintSystemError
>
val
candidate
:
Candidate
,
)
:
ConeDiagnostic
()
{
constructor
(
applicability
:
CandidateApplicability
,
candidate
:
Candidate
)
:
this
(
applicability
,
candidate
.
symbol
,
candidate
.
diagnostics
,
candidate
.
system
.
errors
)
override
val
reason
:
String
get
()
=
"Inapplicable($applicability): ${describeSymbol(candidateSymbol)}"
override
val
reason
:
String
get
()
=
"Inapplicable($applicability): ${describeSymbol(candidate.symbol)}"
}
class
ConeAmbiguityError
(
val
name
:
Name
,
val
applicability
:
CandidateApplicability
,
val
candidates
:
Collection
<
AbstractFirBasedSymbol
<
*
>>)
:
ConeDiagnostic
()
{
...
...
compiler/testData/diagnostics/tests/extensions/kt1875.fir.kt
浏览文件 @
5e150d62
...
...
@@ -9,13 +9,13 @@ interface T {
}
fun
test
(
t
:
T
)
{
t
<!
UNSAFE_CALL
!>.<!>
f
(
1
)
//unsafe call error
t
.<!
UNSAFE_IMPLICIT_INVOKE_CALL
!>
f
<!>
(
1
)
//unsafe call error
t
.
f
?.
invoke
(
1
)
}
fun
test1
(
t
:
T
?)
{
t
.<!
UNRESOLVED_REFERENCE
!>
f
<!>(
1
)
// todo resolve f as value and report UNSAFE_CALL
t
?.
<!
UNSAFE_CALL
!>
f
<!>(
1
)
t
?.
<!
UNSAFE_
IMPLICIT_INVOKE_
CALL
!>
f
<!>(
1
)
t
<!
UNSAFE_CALL
!>.<!>
f
?.
invoke
(
1
)
t
?.
f
?.
invoke
(
1
)
}
compiler/testData/diagnostics/tests/platformTypes/nullabilityWarnings/invoke.fir.kt
已删除
100644 → 0
浏览文件 @
0c0c53cc
// FILE: J.java
import
org.jetbrains.annotations.*;
public
class
J
{
public
interface
Invoke
{
void
invoke
();
}
@NotNull
public
static
Invoke
staticNN
;
@Nullable
public
static
Invoke
staticN
;
public
static
Invoke
staticJ
;
}
// FILE: k.kt
fun
test
()
{
J
.
staticNN
()
J
<
!
UNSAFE_CALL
!
>.<!>
staticN
()
J
.
staticJ
()
}
\ No newline at end of file
compiler/testData/diagnostics/tests/platformTypes/nullabilityWarnings/invoke.kt
浏览文件 @
5e150d62
// FIR_IDENTICAL
// FILE: J.java
import
org.jetbrains.annotations.*;
...
...
compiler/testData/diagnostics/tests/resolve/invoke/errors/unsafeCallWithInvoke.fir.kt
浏览文件 @
5e150d62
...
...
@@ -4,7 +4,7 @@
operator
fun
String
.
invoke
(
i
:
Int
)
{}
fun
foo
(
s
:
String
?)
{
<!
UNSAFE_CALL
!>
s
<!>(
1
)
<!
UNSAFE_
IMPLICIT_INVOKE_
CALL
!>
s
<!>(
1
)
<!
UNSAFE_CALL
!>(
s
?:
null
)(
1
)<!>
<!
UNSAFE_
IMPLICIT_INVOKE_
CALL
!>(
s
?:
null
)(
1
)<!>
}
compiler/testData/diagnostics/tests/resolve/invoke/invokeAndSmartCast.fir.kt
浏览文件 @
5e150d62
...
...
@@ -7,8 +7,8 @@ fun test(a: A) {
(
a
.
x
)(
""
)
}
""
.<!
UNRESOLVED_REFERENCE
!>(
a
.
x
)()<!>
a
<!
UNSAFE_CALL
!>.<!>
x
(
""
)
<!
UNSAFE_CALL
!>(
a
.
x
)(
""
)<!>
a
.<!
UNSAFE_IMPLICIT_INVOKE_CALL
!>
x
<!>
(
""
)
<!
UNSAFE_
IMPLICIT_INVOKE_
CALL
!>(
a
.
x
)(
""
)<!>
with
(
""
)
{
a
.<!
INAPPLICABLE_CANDIDATE
!>
x
<!>()
...
...
compiler/testData/diagnostics/tests/resolve/invoke/kt30695_2.fir.kt
浏览文件 @
5e150d62
...
...
@@ -14,7 +14,7 @@ class MemberInvokeOwner {
class
Cls
{
fun
testImplicitReceiver
()
{
<!
UNSAFE_CALL
!>
nullableExtensionProperty
<!>()
<!
UNSAFE_
IMPLICIT_INVOKE_
CALL
!>
nullableExtensionProperty
<!>()
}
}
...
...
@@ -30,7 +30,7 @@ fun testNullableReceiver(nullable: Cls?) {
}
fun
testNotNullableReceiver
(
notNullable
:
Cls
)
{
notNullable
<!
UNSAFE_CALL
!>.<!>
nullableExtensionProperty
()
notNullable
.<!
UNSAFE_IMPLICIT_INVOKE_CALL
!>
nullableExtensionProperty
<!>
()
notNullable
?.
extensionProperty
()
}
...
...
@@ -38,6 +38,6 @@ fun testFlexibleReceiver() {
val
flexible
=
JavaClass
.
createFlexible
()
flexible
.
extensionProperty
()
flexible
?.
extensionProperty
()
flexible
<!
UNSAFE_CALL
!>.<!>
nullableExtensionProperty
()
flexible
?.
<!
UNSAFE_CALL
!>
nullableExtensionProperty
<!>()
flexible
.<!
UNSAFE_IMPLICIT_INVOKE_CALL
!>
nullableExtensionProperty
<!>
()
flexible
?.
<!
UNSAFE_
IMPLICIT_INVOKE_
CALL
!>
nullableExtensionProperty
<!>()
}
compiler/testData/diagnostics/tests/safeCall.fir.kt
浏览文件 @
5e150d62
// !WITH_NEW_INFERENCE
fun
f
(
s
:
String
,
action
:
(
String
.()
->
Unit
)?)
{
s
.
foo
().
bar
()
<!
UNSAFE_CALL
!>.<!>
action
()
s
.
foo
().
bar
()
.<!
UNSAFE_IMPLICIT_INVOKE_CALL
!>
action
<!>
()
}
fun
String
.
foo
()
=
""
...
...
@@ -12,4 +12,4 @@ fun String.bar() = ""
val
functions
:
Map
<
String
,
()
-
>
Any
>
=
TODO
()
fun
run
(
name
:
String
)
=
<!
UNSAFE_CALL
!>
functions
[
name
]()<!>
\ No newline at end of file
fun
run
(
name
:
String
)
=
<!
UNSAFE_IMPLICIT_INVOKE_CALL
!>
functions
[
name
]()<!>
\ No newline at end of file
compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/1.fir.kt
浏览文件 @
5e150d62
...
...
@@ -361,23 +361,23 @@ fun case_21() {
// TESTCASE NUMBER: 22
fun
case_22
(
a
:
(()
->
Unit
)?)
{
if
(
a
!=
null
!
is
Boolean
)
{
<!
DEBUG_INFO_EXPRESSION_TYPE
(
"kotlin.Unit"
)!><!
UNSAFE_CALL
!>
a
<!>()<!>
<!
DEBUG_INFO_EXPRESSION_TYPE
(
"kotlin.Unit"
)!>
a
()<!><!
UNSAFE_CALL
!>.<!>
equals
(
null
)
<!
DEBUG_INFO_EXPRESSION_TYPE
(
"kotlin.Unit"
)!>
a
()<!><!
UNSAFE_CALL
!>.<!>
propT
<!
DEBUG_INFO_EXPRESSION_TYPE
(
"kotlin.Unit"
)!>
a
()<!><!
UNSAFE_CALL
!>.<!>
propAny
<!
DEBUG_INFO_EXPRESSION_TYPE
(
"kotlin.Unit"
)!>
a
()<!><!
UNSAFE_CALL
!>.<!>
propNullableT
<!
DEBUG_INFO_EXPRESSION_TYPE
(
"kotlin.Unit"
)!>
a
()<!><!
UNSAFE_CALL
!>.<!>
propNullableAny
<!
DEBUG_INFO_EXPRESSION_TYPE
(
"kotlin.Unit"
)!>
a
()<!><!
UNSAFE_CALL
!>.<!>
funT
()
<!
DEBUG_INFO_EXPRESSION_TYPE
(
"kotlin.Unit"
)!>
a
()<!><!
UNSAFE_CALL
!>.<!>
funAny
()
<!
DEBUG_INFO_EXPRESSION_TYPE
(
"kotlin.Unit"
)!>
a
()<!><!
UNSAFE_CALL
!>.<!>
funNullableT
()
<!
DEBUG_INFO_EXPRESSION_TYPE
(
"kotlin.Unit"
)!>
a
()<!><!
UNSAFE_CALL
!>.<!>
funNullableAny
()
<!
DEBUG_INFO_EXPRESSION_TYPE
(
"kotlin.Unit"
)!><!
UNSAFE_
IMPLICIT_INVOKE_
CALL
!>
a
<!>()<!>
<!
DEBUG_INFO_EXPRESSION_TYPE
(
"kotlin.Unit"
)!>
<!
UNSAFE_IMPLICIT_INVOKE_CALL
!>
a
<!>()<!>.
equals
(
null
)
<!
DEBUG_INFO_EXPRESSION_TYPE
(
"kotlin.Unit"
)!>
<!
UNSAFE_IMPLICIT_INVOKE_CALL
!>
a
<!>()<!>.
propT
<!
DEBUG_INFO_EXPRESSION_TYPE
(
"kotlin.Unit"
)!>
<!
UNSAFE_IMPLICIT_INVOKE_CALL
!>
a
<!>()<!>.
propAny
<!
DEBUG_INFO_EXPRESSION_TYPE
(
"kotlin.Unit"
)!>
<!
UNSAFE_IMPLICIT_INVOKE_CALL
!>
a
<!>()<!>.
propNullableT
<!
DEBUG_INFO_EXPRESSION_TYPE
(
"kotlin.Unit"
)!>
<!
UNSAFE_IMPLICIT_INVOKE_CALL
!>
a
<!>()<!>.
propNullableAny
<!
DEBUG_INFO_EXPRESSION_TYPE
(
"kotlin.Unit"
)!>
<!
UNSAFE_IMPLICIT_INVOKE_CALL
!>
a
<!>()<!>.
funT
()
<!
DEBUG_INFO_EXPRESSION_TYPE
(
"kotlin.Unit"
)!>
<!
UNSAFE_IMPLICIT_INVOKE_CALL
!>
a
<!>()<!>.
funAny
()
<!
DEBUG_INFO_EXPRESSION_TYPE
(
"kotlin.Unit"
)!>
<!
UNSAFE_IMPLICIT_INVOKE_CALL
!>
a
<!>()<!>.
funNullableT
()
<!
DEBUG_INFO_EXPRESSION_TYPE
(
"kotlin.Unit"
)!>
<!
UNSAFE_IMPLICIT_INVOKE_CALL
!>
a
<!>()<!>.
funNullableAny
()
}
}
// TESTCASE NUMBER: 23
fun
case_23
(
a
:
((
Float
)
->
Int
?)?,
b
:
Float
?)
{
if
(
a
!=
null
!
is
Boolean
&&
b
!==
null
is
Boolean
)
{
val
x
=
<!
DEBUG_INFO_EXPRESSION_TYPE
(
"kotlin.Int?"
)!><!
UNSAFE_CALL
!>
a
<!>(<!
DEBUG_INFO_EXPRESSION_TYPE
(
"kotlin.Float?"
)!>
b
<!>)<!>
val
x
=
<!
DEBUG_INFO_EXPRESSION_TYPE
(
"kotlin.Int?"
)!><!
UNSAFE_
IMPLICIT_INVOKE_
CALL
!>
a
<!>(<!
DEBUG_INFO_EXPRESSION_TYPE
(
"kotlin.Float?"
)!>
b
<!>)<!>
if
(
x
!=
null
)
{
<!
DEBUG_INFO_EXPRESSION_TYPE
(
"kotlin.Int & kotlin.Int?"
)!>
x
<!>
<!
DEBUG_INFO_EXPRESSION_TYPE
(
"kotlin.Int & kotlin.Int?"
)!>
x
<!>.
equals
(
null
)
...
...
@@ -396,8 +396,8 @@ fun case_23(a: ((Float) -> Int?)?, b: Float?) {
// TESTCASE NUMBER: 24
fun
case_24
(
a
:
((()
->
Unit
)
->
Unit
)?,
b
:
(()
->
Unit
)?)
=
if
(
a
!==
null
is
Boolean
&&
b
!==
null
!
is
Boolean
)
{
<!
UNSAFE_CALL
!>
a
<!>(<!
DEBUG_INFO_EXPRESSION_TYPE
(
"kotlin.Function0<kotlin.Unit>?"
)!>
b
<!>)
<!
UNSAFE_CALL
!>
a
<!>(
b
)
<!
UNSAFE_
IMPLICIT_INVOKE_
CALL
!>
a
<!>(<!
DEBUG_INFO_EXPRESSION_TYPE
(
"kotlin.Function0<kotlin.Unit>?"
)!>
b
<!>)
<!
UNSAFE_
IMPLICIT_INVOKE_
CALL
!>
a
<!>(
b
)
<!
DEBUG_INFO_EXPRESSION_TYPE
(
"kotlin.Function0<kotlin.Unit>?"
)!>
b
<!><!
UNSAFE_CALL
!>.<!>
equals
(
null
)
<!
DEBUG_INFO_EXPRESSION_TYPE
(
"kotlin.Function0<kotlin.Unit>?"
)!>
b
<!>.
propT
<!
DEBUG_INFO_EXPRESSION_TYPE
(
"kotlin.Function0<kotlin.Unit>?"
)!>
b
<!><!
UNSAFE_CALL
!>.<!>
propAny
...
...
@@ -440,7 +440,7 @@ fun case_25(b: Boolean) {
// TESTCASE NUMBER: 26
fun
case_26
(
a
:
((
Float
)
->
Int
?)?,
b
:
Float
?)
{
if
(
a
!=
null
==
true
==
false
&&
b
!=
null
==
true
==
false
)
{
val
x
=
<!
DEBUG_INFO_EXPRESSION_TYPE
(
"kotlin.Int?"
)!><!
UNSAFE_CALL
!>
a
<!>(<!
DEBUG_INFO_EXPRESSION_TYPE
(
"kotlin.Float?"
)!>
b
<!>)<!>
val
x
=
<!
DEBUG_INFO_EXPRESSION_TYPE
(
"kotlin.Int?"
)!><!
UNSAFE_
IMPLICIT_INVOKE_
CALL
!>
a
<!>(<!
DEBUG_INFO_EXPRESSION_TYPE
(
"kotlin.Float?"
)!>
b
<!>)<!>
if
(
x
!=
null
==
true
===
false
)
{
<!
DEBUG_INFO_EXPRESSION_TYPE
(
"kotlin.Int?"
)!>
x
<!>
<!
DEBUG_INFO_EXPRESSION_TYPE
(
"kotlin.Int?"
)!>
x
<!><!
UNSAFE_CALL
!>.<!>
equals
(
null
)
...
...
compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/2.fir.kt
浏览文件 @
5e150d62
...
...
@@ -67,7 +67,7 @@ fun case_3(b: Boolean) {
val y = if (b) x else null
if (false || false || false || false || y !== null) {
val z = <!
DEBUG_INFO_EXPRESSION_TYPE
(
"<anonymous>?"
)!><!
UNSAFE_CALL
!>
y
<!>()<!>
val z = <!
DEBUG_INFO_EXPRESSION_TYPE
(
"<anonymous>?"
)!><!
UNSAFE_
IMPLICIT_INVOKE_
CALL
!>
y
<!>()<!>
<!
DEBUG_INFO_EXPRESSION_TYPE
(
"kotlin.Function0<<anonymous>?>?"
)!>
y
<!><!
UNSAFE_CALL
!>.<!>
equals
(
null
)
<!
DEBUG_INFO_EXPRESSION_TYPE
(
"kotlin.Function0<<anonymous>?>?"
)!>
y
<!>.
propT
<!
DEBUG_INFO_EXPRESSION_TYPE
(
"kotlin.Function0<<anonymous>?>?"
)!>
y
<!><!
UNSAFE_CALL
!>.<!>
propAny
...
...
@@ -87,7 +87,7 @@ fun case_3(b: Boolean) {
// TESTCASE NUMBER: 4
fun
case_4
(
a
:
((
Float
)
->
Int
?)?,
b
:
Float
?)
{
if
(
a
!=
null
==
true
&&
b
!=
null
==
true
||
false
||
false
||
false
||
false
||
false
||
false
||
false
||
false
||
false
)
{
val
x
=
<!
DEBUG_INFO_EXPRESSION_TYPE
(
"kotlin.Int?"
)!><!
UNSAFE_CALL
!>
a
<!>(<!
DEBUG_INFO_EXPRESSION_TYPE
(
"kotlin.Float?"
)!>
b
<!>)<!>
val
x
=
<!
DEBUG_INFO_EXPRESSION_TYPE
(
"kotlin.Int?"
)!><!
UNSAFE_
IMPLICIT_INVOKE_
CALL
!>
a
<!>(<!
DEBUG_INFO_EXPRESSION_TYPE
(
"kotlin.Float?"
)!>
b
<!>)<!>
<!
DEBUG_INFO_EXPRESSION_TYPE
(
"kotlin.Function1<kotlin.Float, kotlin.Int?>?"
)!>
a
<!><!
UNSAFE_CALL
!>.<!>
equals
(
null
)
<!
DEBUG_INFO_EXPRESSION_TYPE
(
"kotlin.Function1<kotlin.Float, kotlin.Int?>?"
)!>
a
<!>.
propT
<!
DEBUG_INFO_EXPRESSION_TYPE
(
"kotlin.Function1<kotlin.Float, kotlin.Int?>?"
)!>
a
<!><!
UNSAFE_CALL
!>.<!>
propAny
...
...
@@ -274,7 +274,7 @@ fun case_11(b: Boolean) {
val y = if (b) x else null
if (y === null && true) else {
val z = <!
DEBUG_INFO_EXPRESSION_TYPE
(
"<anonymous>?"
)!><!
UNSAFE_CALL
!>
y
<!>()<!>
val z = <!
DEBUG_INFO_EXPRESSION_TYPE
(
"<anonymous>?"
)!><!
UNSAFE_
IMPLICIT_INVOKE_
CALL
!>
y
<!>()<!>
<!
DEBUG_INFO_EXPRESSION_TYPE
(
"kotlin.Function0<<anonymous>?>?"
)!>
y
<!><!
UNSAFE_CALL
!>.<!>
equals
(
null
)
<!
DEBUG_INFO_EXPRESSION_TYPE
(
"kotlin.Function0<<anonymous>?>?"
)!>
y
<!>.
propT
<!
DEBUG_INFO_EXPRESSION_TYPE
(
"kotlin.Function0<<anonymous>?>?"
)!>
y
<!><!
UNSAFE_CALL
!>.<!>
propAny
...
...
@@ -298,7 +298,7 @@ fun case_12(a: ((Float) -> Int?)?, b: Float?, c: Boolean?) {
if
(
true
&&
a
==
null
==
true
||
b
==
null
==
true
)
{
}
else
{
val
x
=
<!
DEBUG_INFO_EXPRESSION_TYPE
(
"kotlin.Int?"
)!><!
UNSAFE_CALL
!>
a
<!>(<!
DEBUG_INFO_EXPRESSION_TYPE
(
"kotlin.Float & kotlin.Float?"
)!>
b
<!>)<!>
val
x
=
<!
DEBUG_INFO_EXPRESSION_TYPE
(
"kotlin.Int?"
)!><!
UNSAFE_
IMPLICIT_INVOKE_
CALL
!>
a
<!>(<!
DEBUG_INFO_EXPRESSION_TYPE
(
"kotlin.Float & kotlin.Float?"
)!>
b
<!>)<!>
<!
DEBUG_INFO_EXPRESSION_TYPE
(
"kotlin.Function1<kotlin.Float, kotlin.Int?>?"
)!>
a
<!><!
UNSAFE_CALL
!>.<!>
equals
(
null
)
<!
DEBUG_INFO_EXPRESSION_TYPE
(
"kotlin.Function1<kotlin.Float, kotlin.Int?>?"
)!>
a
<!>.
propT
<!
DEBUG_INFO_EXPRESSION_TYPE
(
"kotlin.Function1<kotlin.Float, kotlin.Int?>?"
)!>
a
<!><!
UNSAFE_CALL
!>.<!>
propAny
...
...
compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/6.fir.kt
浏览文件 @
5e150d62
...
...
@@ -422,7 +422,7 @@ fun case_21() {
// TESTCASE NUMBER: 22
fun
case_22
(
a
:
(()
->
Unit
)?)
{
if
(
a
!=
implicitNullableNothingProperty
)
{
<!
DEBUG_INFO_EXPRESSION_TYPE
(
"kotlin.Unit"
)!><!
UNSAFE_CALL
!>
a
<!>()<!>
<!
DEBUG_INFO_EXPRESSION_TYPE
(
"kotlin.Unit"
)!><!
UNSAFE_
IMPLICIT_INVOKE_
CALL
!>
a
<!>()<!>
<!
DEBUG_INFO_EXPRESSION_TYPE
(
"kotlin.Function0<kotlin.Unit>?"
)!>
a
<!><!
UNSAFE_CALL
!>.<!>
equals
(
null
)
<!
DEBUG_INFO_EXPRESSION_TYPE
(
"kotlin.Function0<kotlin.Unit>?"
)!>
a
<!>.
propT
<!
DEBUG_INFO_EXPRESSION_TYPE
(
"kotlin.Function0<kotlin.Unit>?"
)!>
a
<!><!
UNSAFE_CALL
!>.<!>
propAny
...
...
@@ -438,7 +438,7 @@ fun case_22(a: (() -> Unit)?) {
// TESTCASE NUMBER: 23
fun
case_23
(
a
:
((
Float
)
->
Int
?)?,
b
:
Float
?,
z
:
Nothing
?)
{
if
(
a
!=
z
&&
b
!==
z
&&
b
!==
z
)
{
val
x
=
<!
DEBUG_INFO_EXPRESSION_TYPE
(
"kotlin.Int?"
)!><!
UNSAFE_CALL
!>
a
<!>(<!
DEBUG_INFO_EXPRESSION_TYPE
(
"kotlin.Float?"
)!>
b
<!>)<!>
val
x
=
<!
DEBUG_INFO_EXPRESSION_TYPE
(
"kotlin.Int?"
)!><!
UNSAFE_
IMPLICIT_INVOKE_
CALL
!>
a
<!>(<!
DEBUG_INFO_EXPRESSION_TYPE
(
"kotlin.Float?"
)!>
b
<!>)<!>
if
(
x
!=
z
||
x
!==
implicitNullableNothingProperty
)
{
<!
DEBUG_INFO_EXPRESSION_TYPE
(
"kotlin.Int?"
)!>
x
<!>
<!
DEBUG_INFO_EXPRESSION_TYPE
(
"kotlin.Int?"
)!>
x
<!><!
UNSAFE_CALL
!>.<!>
equals
(
null
)
...
...
@@ -457,7 +457,7 @@ fun case_23(a: ((Float) -> Int?)?, b: Float?, z: Nothing?) {
// TESTCASE NUMBER: 24
fun
case_24
(
a
:
((()
->
Unit
)
->
Unit
)?,
b
:
(()
->
Unit
)?,
z
:
Nothing
?)
=
if
(
a
!==
z
&&
b
!==
z
)
{
<!
UNSAFE_CALL
!>
a
<!>(<!
DEBUG_INFO_EXPRESSION_TYPE
(
"kotlin.Function0<kotlin.Unit>?"
)!>
b
<!>)
<!
UNSAFE_
IMPLICIT_INVOKE_
CALL
!>
a
<!>(<!
DEBUG_INFO_EXPRESSION_TYPE
(
"kotlin.Function0<kotlin.Unit>?"
)!>
b
<!>)
<!
DEBUG_INFO_EXPRESSION_TYPE
(
"kotlin.Function1<kotlin.Function0<kotlin.Unit>, kotlin.Unit>?"
)!>
a
<!><!
UNSAFE_CALL
!>.<!>
equals
(
null
)
<!
DEBUG_INFO_EXPRESSION_TYPE
(
"kotlin.Function1<kotlin.Function0<kotlin.Unit>, kotlin.Unit>?"
)!>
a
<!>.
propT
<!
DEBUG_INFO_EXPRESSION_TYPE
(
"kotlin.Function1<kotlin.Function0<kotlin.Unit>, kotlin.Unit>?"
)!>
a
<!><!
UNSAFE_CALL
!>.<!>
propAny
...
...
@@ -489,7 +489,7 @@ fun case_25(b: Boolean, z: Nothing?) {
val y = if (b) x else z
if (y !== z || y != implicit
NullableNothingProperty
)
{
val
z1
=
<!
DEBUG_INFO_EXPRESSION_TYPE
(
"<anonymous>?"
)!><!
UNSAFE_CALL
!>
y
<!>()<!>
val
z1
=
<!
DEBUG_INFO_EXPRESSION_TYPE
(
"<anonymous>?"
)!><!
UNSAFE_
IMPLICIT_INVOKE_
CALL
!>
y
<!>()<!>
if
(
z1
!=
z
&&
implicitNullableNothingProperty
!==
z1
)
{
<!
DEBUG_INFO_EXPRESSION_TYPE
(
"<anonymous>?"
)!>
z1
<!><!
UNSAFE_CALL
!>.<!>
a
...
...
@@ -511,7 +511,7 @@ fun case_26(a: ((Float) -> Int?)?, b: Float?) {
var
z
=
null
if
(
a
!=
z
==
true
&&
b
!=
implicitNullableNothingProperty
==
true
)
{
val
x
=
<!
DEBUG_INFO_EXPRESSION_TYPE
(
"kotlin.Int?"
)!><!
UNSAFE_CALL
!>
a
<!>(<!
DEBUG_INFO_EXPRESSION_TYPE
(
"kotlin.Float?"
)!>
b
<!>)<!>
val
x
=
<!
DEBUG_INFO_EXPRESSION_TYPE
(
"kotlin.Int?"
)!><!
UNSAFE_
IMPLICIT_INVOKE_
CALL
!>
a
<!>(<!
DEBUG_INFO_EXPRESSION_TYPE
(
"kotlin.Float?"
)!>
b
<!>)<!>
if
(
x
!=
implicitNullableNothingProperty
==
true
||
z
!==
x
)
{
<!
DEBUG_INFO_EXPRESSION_TYPE
(
"kotlin.Int?"
)!>
x
<!>
<!
DEBUG_INFO_EXPRESSION_TYPE
(
"kotlin.Int?"
)!>
x
<!><!
UNSAFE_CALL
!>.<!>
equals
(
null
)
...
...
@@ -575,7 +575,7 @@ fun case_29(x: Boolean) {
val y = if (x) z else null
if (false || false || false || false || y !== v) {
val t = <!
DEBUG_INFO_EXPRESSION_TYPE
(
"<anonymous>?"
)!><!
UNSAFE_CALL
!>
y
<!>()<!>
val t = <!
DEBUG_INFO_EXPRESSION_TYPE
(
"<anonymous>?"
)!><!
UNSAFE_
IMPLICIT_INVOKE_
CALL
!>
y
<!>()<!>
if
(
z
!==
t
||
false
)
{
<!
DEBUG_INFO_EXPRESSION_TYPE
(
"<anonymous>?"
)!>
t
<!><!
UNSAFE_CALL
!>.<!>
a
...
...
@@ -595,7 +595,7 @@ fun case_29(x: Boolean) {
// TESTCASE NUMBER: 30
fun
case_30
(
a
:
((
Float
)
->
Int
?)?,
b
:
Float
?)
{
if
(
implicitNullableNothingProperty
!=
a
==
true
&&
b
!=
implicitNullableNothingProperty
==
true
||
false
||
false
||
false
||
false
||
false
||
false
||
false
||
false
||
false
)
{
val
x
=
<!
DEBUG_INFO_EXPRESSION_TYPE
(
"kotlin.Int?"
)!><!
UNSAFE_CALL
!>
a
<!>(<!
DEBUG_INFO_EXPRESSION_TYPE
(
"kotlin.Float?"
)!>
b
<!>)<!>
val
x
=
<!
DEBUG_INFO_EXPRESSION_TYPE
(
"kotlin.Int?"
)!><!
UNSAFE_
IMPLICIT_INVOKE_
CALL
!>
a
<!>(<!
DEBUG_INFO_EXPRESSION_TYPE
(
"kotlin.Float?"
)!>
b
<!>)<!>
if
(
false
||
implicitNullableNothingProperty
!=
x
==
true
)
{
<!
DEBUG_INFO_EXPRESSION_TYPE
(
"kotlin.Int?"
)!>
x
<!>
<!
DEBUG_INFO_EXPRESSION_TYPE
(
"kotlin.Int?"
)!>
x
<!><!
UNSAFE_CALL
!>.<!>
equals
(
null
)
...
...
@@ -651,7 +651,7 @@ fun case_33(a: ((Float) -> Int?)?, b: Float?, c: Boolean?) {
if
(
true
&&
a
==
z
==
true
||
b
==
null
==
true
)
{
}
else
{
val
x
=
<!
DEBUG_INFO_EXPRESSION_TYPE
(
"kotlin.Int?"
)!><!
UNSAFE_CALL
!>
a
<!>(<!
DEBUG_INFO_EXPRESSION_TYPE
(
"kotlin.Float & kotlin.Float?"
)!>
b
<!>)<!>
val
x
=
<!
DEBUG_INFO_EXPRESSION_TYPE
(
"kotlin.Int?"
)!><!
UNSAFE_
IMPLICIT_INVOKE_
CALL
!>
a
<!>(<!
DEBUG_INFO_EXPRESSION_TYPE
(
"kotlin.Float & kotlin.Float?"
)!>
b
<!>)<!>
if
(
x
==
z
==
true
&&
x
===
z
||
(
c
!=
z
&&
<!
UNSAFE_CALL
!>!<!>
c
))
{
}
else
{
...
...
@@ -1054,7 +1054,7 @@ fun case_60(b: Boolean) {
val
y
=
if
(
b
)
x
else
nullableNothingProperty
if
(
y
!=
nullableNothingProperty
)
{
val
z
=
<!
DEBUG_INFO_EXPRESSION_TYPE
(
"<anonymous>?"
)!><!
UNSAFE_CALL
!>
y
<!>()<!>
val
z
=
<!
DEBUG_INFO_EXPRESSION_TYPE
(
"<anonymous>?"
)!><!
UNSAFE_
IMPLICIT_INVOKE_
CALL
!>
y
<!>()<!>
if
(
z
==
nullableNothingProperty
)
{
<!
DEBUG_INFO_EXPRESSION_TYPE
(
"<anonymous>?"
)!>
z
<!>
...
...
compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/7.fir.kt
浏览文件 @
5e150d62
...
...
@@ -406,7 +406,7 @@ fun case_21() {
fun
case_22
(
a
:
(()
->
Unit
)?)
{
var
y
=
null
if
(
a
!=
null
||
y
!=
a
)
{
<!
DEBUG_INFO_EXPRESSION_TYPE
(
"kotlin.Unit"
)!><!
UNSAFE_CALL
!>
a
<!>()<!>
<!
DEBUG_INFO_EXPRESSION_TYPE
(
"kotlin.Unit"
)!><!
UNSAFE_
IMPLICIT_INVOKE_
CALL
!>
a
<!>()<!>
<!
DEBUG_INFO_EXPRESSION_TYPE
(
"kotlin.Function0<kotlin.Unit>?"
)!>
a
<!><!
UNSAFE_CALL
!>.<!>
equals
(
null
)
<!
DEBUG_INFO_EXPRESSION_TYPE
(
"kotlin.Function0<kotlin.Unit>?"
)!>
a
<!>.
propT
<!
DEBUG_INFO_EXPRESSION_TYPE
(
"kotlin.Function0<kotlin.Unit>?"
)!>
a
<!><!
UNSAFE_CALL
!>.<!>
propAny
...
...
@@ -422,7 +422,7 @@ fun case_22(a: (() -> Unit)?) {
// TESTCASE NUMBER: 23
fun
case_23
(
a
:
((
Float
)
->
Int
?)?,
b
:
Float
?,
c
:
Nothing
?)
{
if
(
a
!=
null
&&
b
!==
null
||
a
!=
c
&&
b
!==
c
)
{
val
x
=
<!
DEBUG_INFO_EXPRESSION_TYPE
(
"kotlin.Int?"
)!><!
UNSAFE_CALL
!>
a
<!>(<!
DEBUG_INFO_EXPRESSION_TYPE
(
"kotlin.Float?"
)!>
b
<!>)<!>
val
x
=
<!
DEBUG_INFO_EXPRESSION_TYPE
(
"kotlin.Int?"
)!><!
UNSAFE_
IMPLICIT_INVOKE_
CALL
!>
a
<!>(<!
DEBUG_INFO_EXPRESSION_TYPE
(
"kotlin.Float?"
)!>
b
<!>)<!>
if
(
x
!=
null
||
c
!==
x
)
{
<!
DEBUG_INFO_EXPRESSION_TYPE
(
"kotlin.Int?"
)!>
x
<!>
<!
DEBUG_INFO_EXPRESSION_TYPE
(
"kotlin.Int?"
)!>
x
<!><!
UNSAFE_CALL
!>.<!>
equals
(
null
)
...
...
@@ -441,7 +441,7 @@ fun case_23(a: ((Float) -> Int?)?, b: Float?, c: Nothing?) {
// TESTCASE NUMBER: 24
fun
case_24
(
a
:
((()
->
Unit
)
->
Unit
)?,
b
:
(()
->
Unit
)?)
=
if
(
a
!==
null
&&
b
!==
null
||
implicitNullableNothingProperty
!=
a
&&
nullableNothingProperty
!==
b
)
{
<!
UNSAFE_CALL
!>
a
<!>(<!
DEBUG_INFO_EXPRESSION_TYPE
(
"kotlin.Function0<kotlin.Unit>?"
)!>
b
<!>)
<!
UNSAFE_
IMPLICIT_INVOKE_
CALL
!>
a
<!>(<!
DEBUG_INFO_EXPRESSION_TYPE
(
"kotlin.Function0<kotlin.Unit>?"
)!>
b
<!>)
<!
DEBUG_INFO_EXPRESSION_TYPE
(
"kotlin.Function1<kotlin.Function0<kotlin.Unit>, kotlin.Unit>?"
)!>
a
<!><!
UNSAFE_CALL
!>.<!>
equals
(
null
)
<!
DEBUG_INFO_EXPRESSION_TYPE
(
"kotlin.Function1<kotlin.Function0<kotlin.Unit>, kotlin.Unit>?"
)!>
a
<!>.
propT
<!
DEBUG_INFO_EXPRESSION_TYPE
(
"kotlin.Function1<kotlin.Function0<kotlin.Unit>, kotlin.Unit>?"
)!>
a
<!><!
UNSAFE_CALL
!>.<!>
propAny
...
...
@@ -475,7 +475,7 @@ fun case_25(b: Boolean) {
if (y !== null || x()!!.b != y) {
if (x()!!.b != y) {
val z = <!
DEBUG_INFO_EXPRESSION_TYPE
(
"<anonymous>?"
)!><!
UNSAFE_CALL
!>
y
<!>()<!>
val z = <!
DEBUG_INFO_EXPRESSION_TYPE
(
"<anonymous>?"
)!><!
UNSAFE_
IMPLICIT_INVOKE_
CALL
!>
y
<!>()<!>
if
(
z
!=
null
)
{
<!
DEBUG_INFO_EXPRESSION_TYPE
(
"<anonymous> & <anonymous>?"
)!>
z
<!>.
a
...
...
@@ -498,7 +498,7 @@ fun case_26(a: ((Float) -> Int?)?, b: Float?) {
var
c
:
Nothing
?
=
null
if
(
a
!=
null
==
true
&&
b
!=
null
==
true
||
c
!=
a
==
true
&&
b
!=
c
==
true
)
{
val
x
=
<!
DEBUG_INFO_EXPRESSION_TYPE
(
"kotlin.Int?"
)!><!
UNSAFE_CALL
!>
a
<!>(<!
DEBUG_INFO_EXPRESSION_TYPE
(
"kotlin.Float?"
)!>
b
<!>)<!>
val
x
=
<!
DEBUG_INFO_EXPRESSION_TYPE
(
"kotlin.Int?"
)!><!
UNSAFE_
IMPLICIT_INVOKE_
CALL
!>
a
<!>(<!
DEBUG_INFO_EXPRESSION_TYPE
(
"kotlin.Float?"
)!>
b
<!>)<!>
if
(
x
!=
null
==
true
)
{
<!
DEBUG_INFO_EXPRESSION_TYPE
(
"kotlin.Int & kotlin.Int?"
)!>
x
<!>
<!
DEBUG_INFO_EXPRESSION_TYPE
(
"kotlin.Int & kotlin.Int?"
)!>
x
<!>.
equals
(
null
)
...
...
idea/idea-frontend-fir/src/org/jetbrains/kotlin/idea/fir/FirUtils.kt
浏览文件 @
5e150d62
...
...
@@ -41,7 +41,7 @@ internal fun FirReference.getResolvedKtSymbolOfNameReference(builder: KtSymbolBy
internal
fun
FirErrorNamedReference
.
getCandidateSymbols
():
Collection
<
FirBasedSymbol
<
*
>>
=
when
(
val
diagnostic
=
diagnostic
)
{
is
ConeInapplicableCandidateError
->
listOf
(
diagnostic
.
candidate
S
ymbol
)
is
ConeInapplicableCandidateError
->
listOf
(
diagnostic
.
candidate
.
s
ymbol
)
is
ConeHiddenCandidateError
->
listOf
(
diagnostic
.
candidateSymbol
)
is
ConeAmbiguityError
->
diagnostic
.
candidates
is
ConeOperatorAmbiguityError
->
diagnostic
.
candidates
...
...
idea/idea-frontend-fir/src/org/jetbrains/kotlin/idea/references/FirReferenceResolveHelper.kt
浏览文件 @
5e150d62
...
...
@@ -268,7 +268,7 @@ internal object FirReferenceResolveHelper {
val
candidates
=
when
(
val
diagnostic
=
fir
.
diagnostic
)
{
is
ConeAmbiguityError
->
diagnostic
.
candidates
is
ConeOperatorAmbiguityError
->
diagnostic
.
candidates
is
ConeInapplicableCandidateError
->
listOf
(
diagnostic
.
candidate
S
ymbol
)
is
ConeInapplicableCandidateError
->
listOf
(
diagnostic
.
candidate
.
s
ymbol
)
else
->
emptyList
()
}
return
candidates
.
mapNotNull
{
it
.
fir
.
buildSymbol
(
symbolBuilder
)
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录