Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
硅谷海盗
kotlin
提交
f1d8a6e5
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,发现更多精彩内容 >>
提交
f1d8a6e5
编写于
1月 19, 2021
作者:
J
Jinseong Jeon
提交者:
Mikhail Glukhikh
1月 21, 2021
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
FIR checker: introduce DECLARATION_SIGNATURE_OR_DEFAULT positioning strategy
and fix CONFLICTING_OVERLOADS to use it
上级
2e4daee1
变更
31
隐藏空白更改
内联
并排
Showing
31 changed file
with
126 addition
and
128 deletion
+126
-128
compiler/fir/analysis-tests/testData/resolve/diagnostics/conflictingOverloads.kt
...ests/testData/resolve/diagnostics/conflictingOverloads.kt
+6
-6
compiler/fir/analysis-tests/testData/resolve/smartcasts/receivers/mixingImplicitAndExplicitReceivers.kt
...martcasts/receivers/mixingImplicitAndExplicitReceivers.kt
+2
-2
compiler/fir/analysis-tests/testData/resolve/smartcasts/safeCalls/assignSafeCall.kt
...s/testData/resolve/smartcasts/safeCalls/assignSafeCall.kt
+2
-2
compiler/fir/analysis-tests/testData/resolve/whenElse.kt
compiler/fir/analysis-tests/testData/resolve/whenElse.kt
+2
-2
compiler/fir/analysis-tests/testData/resolveWithStdlib/callableReferences/beyoundCalls.kt
...Data/resolveWithStdlib/callableReferences/beyoundCalls.kt
+2
-2
compiler/fir/analysis-tests/testData/resolveWithStdlib/lowPriorityInResolution.kt
...sts/testData/resolveWithStdlib/lowPriorityInResolution.kt
+3
-3
compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/diagnostics/FirErrors.kt
...rg/jetbrains/kotlin/fir/analysis/diagnostics/FirErrors.kt
+1
-1
compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/diagnostics/LightTreePositioningStrategies.kt
...ir/analysis/diagnostics/LightTreePositioningStrategies.kt
+24
-0
compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/diagnostics/SourceElementPositioningStrategies.kt
...nalysis/diagnostics/SourceElementPositioningStrategies.kt
+5
-0
compiler/testData/diagnostics/tests/dataClasses/conflictingCopyOverloads.fir.kt
...nostics/tests/dataClasses/conflictingCopyOverloads.fir.kt
+2
-2
compiler/testData/diagnostics/tests/declarationChecks/MultiDeclarationErrors.fir.kt
...ics/tests/declarationChecks/MultiDeclarationErrors.fir.kt
+2
-2
compiler/testData/diagnostics/tests/declarationChecks/destructuringDeclarations/ForLoopComponentFunctionAmbiguity.fir.kt
...ringDeclarations/ForLoopComponentFunctionAmbiguity.fir.kt
+2
-2
compiler/testData/diagnostics/tests/multiplatform/topLevelFun/conflictingImplDeclarations.fir.kt
...tiplatform/topLevelFun/conflictingImplDeclarations.fir.kt
+4
-4
compiler/testData/diagnostics/tests/multiplatform/topLevelFun/headerDeclarationWithBody.fir.kt
...ultiplatform/topLevelFun/headerDeclarationWithBody.fir.kt
+1
-1
compiler/testData/diagnostics/tests/overload/ConflictingOverloadsFunsDifferentReturnInClass.fir.kt
...oad/ConflictingOverloadsFunsDifferentReturnInClass.fir.kt
+3
-3
compiler/testData/diagnostics/tests/overload/ConflictingOverloadsFunsDifferentReturnInPackage.fir.kt
...d/ConflictingOverloadsFunsDifferentReturnInPackage.fir.kt
+4
-4
compiler/testData/diagnostics/tests/overload/ConflictingOverloadsIdenticalExtFunsInPackage.fir.kt
...load/ConflictingOverloadsIdenticalExtFunsInPackage.fir.kt
+2
-2
compiler/testData/diagnostics/tests/overload/ConflictingOverloadsIdenticalFunsInClass.fir.kt
.../overload/ConflictingOverloadsIdenticalFunsInClass.fir.kt
+0
-7
compiler/testData/diagnostics/tests/overload/ConflictingOverloadsIdenticalFunsInClass.kt
...ests/overload/ConflictingOverloadsIdenticalFunsInClass.kt
+1
-0
compiler/testData/diagnostics/tests/overload/TypeParameterMultipleBounds.fir.kt
...nostics/tests/overload/TypeParameterMultipleBounds.fir.kt
+0
-15
compiler/testData/diagnostics/tests/overload/TypeParameterMultipleBounds.kt
...diagnostics/tests/overload/TypeParameterMultipleBounds.kt
+1
-0
compiler/testData/diagnostics/tests/override/DuplicateMethod.fir.kt
...estData/diagnostics/tests/override/DuplicateMethod.fir.kt
+0
-8
compiler/testData/diagnostics/tests/override/DuplicateMethod.kt
...er/testData/diagnostics/tests/override/DuplicateMethod.kt
+1
-0
compiler/testData/diagnostics/tests/redeclarations/RedeclarationMainInFile.fir.kt
...stics/tests/redeclarations/RedeclarationMainInFile.fir.kt
+0
-5
compiler/testData/diagnostics/tests/redeclarations/RedeclarationMainInFile.kt
...agnostics/tests/redeclarations/RedeclarationMainInFile.kt
+1
-0
compiler/testData/diagnostics/tests/redeclarations/RedeclaringPrivateToFile.fir.kt
...tics/tests/redeclarations/RedeclaringPrivateToFile.fir.kt
+6
-6
compiler/testData/diagnostics/tests/redeclarations/kt470.fir.kt
...er/testData/diagnostics/tests/redeclarations/kt470.fir.kt
+14
-14
compiler/testData/diagnostics/tests/resolve/resolveWithRedeclarationError.fir.kt
...ostics/tests/resolve/resolveWithRedeclarationError.fir.kt
+27
-27
compiler/testData/diagnostics/testsWithStdLib/coroutines/suspendConflictsWithNoSuspend.fir.kt
...ithStdLib/coroutines/suspendConflictsWithNoSuspend.fir.kt
+4
-4
compiler/testData/diagnostics/testsWithStdLib/inference/annotationsForResolve/noInferAndLowPriority.fir.kt
...erence/annotationsForResolve/noInferAndLowPriority.fir.kt
+2
-2
compiler/testData/diagnostics/testsWithStdLib/inference/annotationsForResolve/onlyInputTypesAndLowPriority.fir.kt
...annotationsForResolve/onlyInputTypesAndLowPriority.fir.kt
+2
-2
未找到文件。
compiler/fir/analysis-tests/testData/resolve/diagnostics/conflictingOverloads.kt
浏览文件 @
f1d8a6e5
<!
CONFLICTING_OVERLOADS
!>
fun
test
(
x
:
Int
)
{}<!>
<!
CONFLICTING_OVERLOADS
{
LT
}!><!
CONFLICTING_OVERLOADS
{
PSI
}!>
fun
test
(
x
:
Int
)<!>
{}<!>
<!
CONFLICTING_OVERLOADS
!>
fun
test
(
y
:
Int
)
{}<!>
<!
CONFLICTING_OVERLOADS
{
LT
}!><!
CONFLICTING_OVERLOADS
{
PSI
}!>
fun
test
(
y
:
Int
)<!>
{}<!>
fun
test
()
{}
...
...
@@ -17,9 +17,9 @@ fun test(z: Int, c: Char) {}
}<!>
<!
REDECLARATION
!>
class
B
:
A
{
<!
CONFLICTING_OVERLOADS
!>
override
fun
rest
(
s
:
String
)
{}<!>
<!
CONFLICTING_OVERLOADS
{
LT
}!><!
CONFLICTING_OVERLOADS
{
PSI
}!>
override
fun
rest
(
s
:
String
)<!>
{}<!>
<!
CONFLICTING_OVERLOADS
!>
fun
rest
(
s
:
String
)
{}<!>
<!
CONFLICTING_OVERLOADS
{
LT
}!><!
CONFLICTING_OVERLOADS
{
PSI
}!>
fun
rest
(
s
:
String
)<!>
{}<!>
fun
rest
(
l
:
Long
)
{}
...
...
@@ -45,8 +45,8 @@ fun <T : Int> kek(t: T) {}
fun
lol
(
a
:
Array
<
Int
>)
{}
fun
lol
(
a
:
Array
<
Boolean
>)
{}
<!
CONFLICTING_OVERLOADS
!>
fun
<
T
>
mem
(
t
:
T
)
where
T
:
()
->
Boolean
,
T
:
String
{}<!>
<!
CONFLICTING_OVERLOADS
!>
fun
<
T
>
mem
(
t
:
T
)
where
T
:
String
,
T
:
()
->
Boolean
{}<!>
<!
CONFLICTING_OVERLOADS
{
LT
}!><!
CONFLICTING_OVERLOADS
{
PSI
}!>
fun
<
T
>
mem
(
t
:
T
)<!>
where
T
:
()
->
Boolean
,
T
:
String
{}<!>
<!
CONFLICTING_OVERLOADS
{
LT
}!><!
CONFLICTING_OVERLOADS
{
PSI
}!>
fun
<
T
>
mem
(
t
:
T
)<!>
where
T
:
String
,
T
:
()
->
Boolean
{}<!>
class
M
{
<!
REDECLARATION
{
LT
}!>
companion
<!
REDECLARATION
{
PSI
}!>
object
<!>
{}<!>
...
...
compiler/fir/analysis-tests/testData/resolve/smartcasts/receivers/mixingImplicitAndExplicitReceivers.kt
浏览文件 @
f1d8a6e5
<!
CONFLICTING_OVERLOADS
!>
fun
takeString
(
s
:
String
)
{}<!>
<!
CONFLICTING_OVERLOADS
{
LT
}!><!
CONFLICTING_OVERLOADS
{
PSI
}!>
fun
takeString
(
s
:
String
)<!>
{}<!>
class
Wrapper
(
val
s
:
String
?)
{
fun
withThis
()
{
...
...
@@ -11,4 +11,4 @@ class Wrapper(val s: String?) {
}
}
<!
CONFLICTING_OVERLOADS
!>
fun
takeString
(
s
:
String
)
{}<!>
<!
CONFLICTING_OVERLOADS
{
LT
}!><!
CONFLICTING_OVERLOADS
{
PSI
}!>
fun
takeString
(
s
:
String
)<!>
{}<!>
compiler/fir/analysis-tests/testData/resolve/smartcasts/safeCalls/assignSafeCall.kt
浏览文件 @
f1d8a6e5
...
...
@@ -23,7 +23,7 @@ fun test_2(a: A?) {
}
}
<!
CONFLICTING_OVERLOADS
!>
fun
test_3
(
x
:
Any
?)
{
<!
CONFLICTING_OVERLOADS
{
LT
}!><!
CONFLICTING_OVERLOADS
{
PSI
}!>
fun
test_3
(
x
:
Any
?)<!>
{
val
a
=
x
as
?
A
?:
return
a
.
foo
()
// Should be OK
x
.
foo
()
// Should be OK
...
...
@@ -53,7 +53,7 @@ fun test_2(a: B?) {
}
}
<!
CONFLICTING_OVERLOADS
!>
fun
test_3
(
x
:
Any
?)
{
<!
CONFLICTING_OVERLOADS
{
LT
}!><!
CONFLICTING_OVERLOADS
{
PSI
}!>
fun
test_3
(
x
:
Any
?)<!>
{
val
a
=
x
as
?
B
?:
return
a
.
foo
()
// Should be OK
x
.
foo
()
// Should be OK
...
...
compiler/fir/analysis-tests/testData/resolve/whenElse.kt
浏览文件 @
f1d8a6e5
...
...
@@ -13,7 +13,7 @@ class B()
class
C
(
val
b
:
B
)
fun
get
(
f
:
Boolean
)
=
if
(
f
)
{
A
.
A1
}
else
{
""
}
<!
CONFLICTING_OVERLOADS
!>
fun
case2
()
{
<!
CONFLICTING_OVERLOADS
{
LT
}!><!
CONFLICTING_OVERLOADS
{
PSI
}!>
fun
case2
()<!>
{
val
flag
:
Any
=
get
(
false
)
//string
val
l1
=
when
(
flag
!!
)
{
// should be NO_ELSE_IN_WHEN
...
...
@@ -27,7 +27,7 @@ fun get(f: Boolean) = if (f) {A.A1} else {""}
}
}<!>
<!
CONFLICTING_OVERLOADS
!>
fun
case2
()
{
<!
CONFLICTING_OVERLOADS
{
LT
}!><!
CONFLICTING_OVERLOADS
{
PSI
}!>
fun
case2
()<!>
{
val
flag
:
Any
=
get
(
true
)
//A
val
l1
=
when
(
flag
!!
)
{
// should be NO_ELSE_IN_WHEN
...
...
compiler/fir/analysis-tests/testData/resolveWithStdlib/callableReferences/beyoundCalls.kt
浏览文件 @
f1d8a6e5
<!
CONFLICTING_OVERLOADS
!>
fun
bar
(
x
:
String
):
Int
=
1
<!>
<!
CONFLICTING_OVERLOADS
!>
fun
bar
(
x
:
String
):
Double
=
1
<!>
<!
CONFLICTING_OVERLOADS
{
LT
}!><!
CONFLICTING_OVERLOADS
!>
fun
bar
(
x
:
String
):
Int
<
!
>
=
1
<!>
<!
CONFLICTING_OVERLOADS
{
LT
}!><!
CONFLICTING_OVERLOADS
!>
fun
bar
(
x
:
String
):
Double
<
!
>
=
1
<!>
fun
baz
(
x
:
String
):
Int
=
1
fun
<
T
,
R
>
foobaz
(
x
:
T
):
R
=
TODO
()
...
...
compiler/fir/analysis-tests/testData/resolveWithStdlib/lowPriorityInResolution.kt
浏览文件 @
f1d8a6e5
<!
CONFLICTING_OVERLOADS
!>
@Suppress
(
"INVISIBLE_MEMBER"
,
"INVISIBLE_REFERENCE"
)
<!
CONFLICTING_OVERLOADS
{
LT
}!><!
CONFLICTING_OVERLOADS
!>
@Suppress
(
"INVISIBLE_MEMBER"
,
"INVISIBLE_REFERENCE"
)
<!
HIDDEN
!>
@
kotlin
.
internal
.
LowPriorityInOverloadResolution
<
!
>
fun
foo
():
Int
=
1
<!>
fun
foo
():
Int
<
!
>
=
1
<!>
<!
CONFLICTING_OVERLOADS
!>
fun
foo
():
String
=
""
<!>
<!
CONFLICTING_OVERLOADS
{
LT
}!><!
CONFLICTING_OVERLOADS
!>
fun
foo
():
String
<
!
>
=
""
<!>
fun
test
()
{
val
s
=
foo
()
...
...
compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/diagnostics/FirErrors.kt
浏览文件 @
f1d8a6e5
...
...
@@ -139,7 +139,7 @@ object FirErrors {
// Redeclarations
val
MANY_COMPANION_OBJECTS
by
error0
<
FirSourceElement
,
PsiElement
>()
val
CONFLICTING_OVERLOADS
by
error1
<
FirSourceElement
,
PsiElement
,
String
>()
val
CONFLICTING_OVERLOADS
by
error1
<
FirSourceElement
,
PsiElement
,
String
>(
SourceElementPositioningStrategies
.
DECLARATION_SIGNATURE_OR_DEFAULT
)
val
REDECLARATION
by
error1
<
FirSourceElement
,
PsiElement
,
String
>()
val
ANY_METHOD_IMPLEMENTED_IN_INTERFACE
by
error0
<
FirSourceElement
,
PsiElement
>()
...
...
compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/diagnostics/LightTreePositioningStrategies.kt
浏览文件 @
f1d8a6e5
...
...
@@ -145,6 +145,30 @@ object LightTreePositioningStrategies {
}
}
val
DECLARATION_SIGNATURE_OR_DEFAULT
:
LightTreePositioningStrategy
=
object
:
LightTreePositioningStrategy
()
{
override
fun
mark
(
node
:
LighterASTNode
,
tree
:
FlyweightCapableTreeStructure
<
LighterASTNode
>):
List
<
TextRange
>
=
if
(
node
.
isDeclaration
)
{
DECLARATION_SIGNATURE
.
mark
(
node
,
tree
)
}
else
{
DEFAULT
.
mark
(
node
,
tree
)
}
private
val
LighterASTNode
.
isDeclaration
:
Boolean
get
()
=
when
(
tokenType
)
{
KtNodeTypes
.
PRIMARY_CONSTRUCTOR
,
KtNodeTypes
.
SECONDARY_CONSTRUCTOR
,
KtNodeTypes
.
FUN
,
KtNodeTypes
.
FUNCTION_LITERAL
,
KtNodeTypes
.
PROPERTY
,
KtNodeTypes
.
PROPERTY_ACCESSOR
,
KtNodeTypes
.
CLASS
,
KtNodeTypes
.
OBJECT_DECLARATION
,
KtNodeTypes
.
CLASS_INITIALIZER
->
true
else
->
false
}
}
private
class
ModifierSetBasedLightTreePositioningStrategy
(
private
val
modifierSet
:
TokenSet
)
:
LightTreePositioningStrategy
()
{
override
fun
mark
(
node
:
LighterASTNode
,
tree
:
FlyweightCapableTreeStructure
<
LighterASTNode
>):
List
<
TextRange
>
{
tree
.
findChildByType
(
node
,
modifierSet
)
?.
let
{
return
markElement
(
it
,
tree
)
}
...
...
compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/diagnostics/SourceElementPositioningStrategies.kt
浏览文件 @
f1d8a6e5
...
...
@@ -33,6 +33,11 @@ object SourceElementPositioningStrategies {
PositioningStrategies
.
DECLARATION_SIGNATURE
)
val
DECLARATION_SIGNATURE_OR_DEFAULT
=
SourceElementPositioningStrategy
(
LightTreePositioningStrategies
.
DECLARATION_SIGNATURE_OR_DEFAULT
,
PositioningStrategies
.
DECLARATION_SIGNATURE_OR_DEFAULT
)
val
VISIBILITY_MODIFIER
=
SourceElementPositioningStrategy
(
LightTreePositioningStrategies
.
VISIBILITY_MODIFIER
,
PositioningStrategies
.
VISIBILITY_MODIFIER
...
...
compiler/testData/diagnostics/tests/dataClasses/conflictingCopyOverloads.fir.kt
浏览文件 @
f1d8a6e5
// !DIAGNOSTICS: -UNUSED_PARAMETER
data class
A
(
val
x
:
Int
,
val
y
:
String
)
{
<!
CONFLICTING_OVERLOADS
!>
fun
copy
(
x
:
Int
,
y
:
String
)
=
x
<!>
<!
CONFLICTING_OVERLOADS
!>
fun
copy
(
x
:
Int
,
y
:
String
)
=
A
(
x
,
y
)<!>
<!
CONFLICTING_OVERLOADS
!>
fun
copy
(
x
:
Int
,
y
:
String
)
<!>
=
x
<!
CONFLICTING_OVERLOADS
!>
fun
copy
(
x
:
Int
,
y
:
String
)
<!>
=
A
(
x
,
y
)
}
\ No newline at end of file
compiler/testData/diagnostics/tests/declarationChecks/MultiDeclarationErrors.fir.kt
浏览文件 @
f1d8a6e5
...
...
@@ -7,8 +7,8 @@ class MyClass {
class
MyClass2
{}
<!
CONFLICTING_OVERLOADS
!>
fun
MyClass2
.
component1
()
=
1.2
<!>
<!
CONFLICTING_OVERLOADS
!>
fun
MyClass2
.
component1
()
=
1.3
<!>
<!
CONFLICTING_OVERLOADS
!>
fun
MyClass2
.
component1
()
<!>
=
1.2
<!
CONFLICTING_OVERLOADS
!>
fun
MyClass2
.
component1
()
<!>
=
1.3
fun
test
(
mc1
:
MyClass
,
mc2
:
MyClass2
)
{
val
(
<!
INAPPLICABLE_CANDIDATE
!>
a
<!>
,
<!
UNRESOLVED_REFERENCE
!>
b
<!>
)
=
mc1
...
...
compiler/testData/diagnostics/tests/declarationChecks/destructuringDeclarations/ForLoopComponentFunctionAmbiguity.fir.kt
浏览文件 @
f1d8a6e5
class
A
{
<!
CONFLICTING_OVERLOADS
!>
operator
fun
component1
()
=
1
<!>
<!
CONFLICTING_OVERLOADS
!>
operator
fun
component1
()
=
1
<!>
<!
CONFLICTING_OVERLOADS
!>
operator
fun
component1
()
<!>
=
1
<!
CONFLICTING_OVERLOADS
!>
operator
fun
component1
()
<!>
=
1
operator
fun
component2
()
=
1
}
...
...
compiler/testData/diagnostics/tests/multiplatform/topLevelFun/conflictingImplDeclarations.fir.kt
浏览文件 @
f1d8a6e5
...
...
@@ -7,11 +7,11 @@ expect fun foo()
// MODULE: m2-jvm(m1-common)
// FILE: jvm.kt
<!
CONFLICTING_OVERLOADS
!>
actual
fun
foo
()
{}<!>
<!
CONFLICTING_OVERLOADS
!>
actual
fun
foo
()
{}<!>
<!
CONFLICTING_OVERLOADS
!>
actual
fun
foo
()
<!>
{}
<!
CONFLICTING_OVERLOADS
!>
actual
fun
foo
()
<!>
{}
// MODULE: m3-js(m1-common)
// FILE: js.kt
<!
CONFLICTING_OVERLOADS
!>
actual
fun
foo
()
{}<!>
<!
CONFLICTING_OVERLOADS
!>
actual
fun
foo
()
{}<!>
<!
CONFLICTING_OVERLOADS
!>
actual
fun
foo
()
<!>
{}
<!
CONFLICTING_OVERLOADS
!>
actual
fun
foo
()
<!>
{}
compiler/testData/diagnostics/tests/multiplatform/topLevelFun/headerDeclarationWithBody.fir.kt
浏览文件 @
f1d8a6e5
...
...
@@ -4,6 +4,6 @@
<!
CONFLICTING_OVERLOADS
!>
expect
fun
foo
()<!>
<!
CONFLICTING_OVERLOADS
!>
expect
fun
foo
()
{}<!>
<!
CONFLICTING_OVERLOADS
!>
expect
fun
foo
()
<!>
{}
expect
fun
bar
()
{}
compiler/testData/diagnostics/tests/overload/ConflictingOverloadsFunsDifferentReturnInClass.fir.kt
浏览文件 @
f1d8a6e5
class
A
{
<!
CONFLICTING_OVERLOADS
!>
fun
a
(
a
:
Int
):
Int
=
0
<!>
<!
CONFLICTING_OVERLOADS
!>
fun
a
(
a
:
Int
):
Int
<
!
>
=
0
<!
CONFLICTING_OVERLOADS
!>
fun
a
(
a
:
Int
)
{
}
<!>
<!
CONFLICTING_OVERLOADS
!>
fun
a
(
a
:
Int
)
<!>
{
}
}
compiler/testData/diagnostics/tests/overload/ConflictingOverloadsFunsDifferentReturnInPackage.fir.kt
浏览文件 @
f1d8a6e5
package
qwertyuiop
<!
CONFLICTING_OVERLOADS
!>
fun
c
(
s
:
String
)
{
}
<!>
<!
CONFLICTING_OVERLOADS
!>
fun
c
(
s
:
String
)
<!>
{
}
<!
CONFLICTING_OVERLOADS
!>
fun
c
(
s
:
String
)
{
}
<!>
<!
CONFLICTING_OVERLOADS
!>
fun
c
(
s
:
String
)
<!>
{
}
compiler/testData/diagnostics/tests/overload/ConflictingOverloadsIdenticalExtFunsInPackage.fir.kt
浏览文件 @
f1d8a6e5
package
extensionFunctions
<!
CONFLICTING_OVERLOADS
!>
fun
Int
.
qwe
(
a
:
Float
)
=
1
<!>
<!
CONFLICTING_OVERLOADS
!>
fun
Int
.
qwe
(
a
:
Float
)
<!>
=
1
<!
CONFLICTING_OVERLOADS
!>
fun
Int
.
qwe
(
a
:
Float
)
=
2
<!>
<!
CONFLICTING_OVERLOADS
!>
fun
Int
.
qwe
(
a
:
Float
)
<!>
=
2
compiler/testData/diagnostics/tests/overload/ConflictingOverloadsIdenticalFunsInClass.fir.kt
已删除
100644 → 0
浏览文件 @
2e4daee1
class
A
()
{
<!
CONFLICTING_OVERLOADS
!>
fun
b
()
{
}<!>
<!
CONFLICTING_OVERLOADS
!>
fun
b
()
{
}<!>
}
compiler/testData/diagnostics/tests/overload/ConflictingOverloadsIdenticalFunsInClass.kt
浏览文件 @
f1d8a6e5
// FIR_IDENTICAL
class
A
()
{
<!
CONFLICTING_OVERLOADS
!>
fun
b
()<!>
{
}
...
...
compiler/testData/diagnostics/tests/overload/TypeParameterMultipleBounds.fir.kt
已删除
100644 → 0
浏览文件 @
2e4daee1
import
java.io.Serializable
interface
Test1
{
<!
CONFLICTING_OVERLOADS
!>
fun
<
T
>
foo
(
t
:
T
)
where
T
:
Cloneable
,
T
:
Serializable
<
!
>
<!
CONFLICTING_OVERLOADS
!>
fun
<
T
>
foo
(
t
:
T
)
where
T
:
Serializable
,
T
:
Cloneable
<
!
>
}
interface
I1
interface
I2
:
I1
interface
Test2
{
<!
CONFLICTING_OVERLOADS
!>
fun
<
T
>
foo
(
t
:
T
)
where
T
:
I1
,
T
:
I2
<
!
>
<!
CONFLICTING_OVERLOADS
!>
fun
<
T
>
foo
(
t
:
T
)
where
T
:
I2
,
T
:
I1
<
!
>
}
compiler/testData/diagnostics/tests/overload/TypeParameterMultipleBounds.kt
浏览文件 @
f1d8a6e5
// FIR_IDENTICAL
import
java.io.Serializable
interface
Test1
{
...
...
compiler/testData/diagnostics/tests/override/DuplicateMethod.fir.kt
已删除
100644 → 0
浏览文件 @
2e4daee1
interface
Some
{
fun
test
()
}
class
SomeImpl
:
Some
{
<!
CONFLICTING_OVERLOADS
!>
override
fun
test
()
{}<!>
<!
CONFLICTING_OVERLOADS
!>
override
fun
test
()
{}<!>
}
\ No newline at end of file
compiler/testData/diagnostics/tests/override/DuplicateMethod.kt
浏览文件 @
f1d8a6e5
// FIR_IDENTICAL
interface
Some
{
fun
test
()
}
...
...
compiler/testData/diagnostics/tests/redeclarations/RedeclarationMainInFile.fir.kt
已删除
100644 → 0
浏览文件 @
2e4daee1
// !DIAGNOSTICS: -UNUSED_PARAMETER
// KT-9733 No error shown for 2 "main" functions in the same file
<!
CONFLICTING_OVERLOADS
!>
fun
main
(
args
:
Array
<
String
>)
{}<!>
<!
CONFLICTING_OVERLOADS
!>
fun
main
(
args
:
Array
<
String
>)
{}<!>
\ No newline at end of file
compiler/testData/diagnostics/tests/redeclarations/RedeclarationMainInFile.kt
浏览文件 @
f1d8a6e5
// FIR_IDENTICAL
// !DIAGNOSTICS: -UNUSED_PARAMETER
// KT-9733 No error shown for 2 "main" functions in the same file
...
...
compiler/testData/diagnostics/tests/redeclarations/RedeclaringPrivateToFile.fir.kt
浏览文件 @
f1d8a6e5
...
...
@@ -14,16 +14,16 @@ private val invalidProp0 = 1
fun
useInvalidFun0
()
=
invalidFun0
()
fun
useInvalidProp0
()
=
invalidProp0
<!
CONFLICTING_OVERLOADS
!>
private
fun
invalidFun1
()
{}<!>
<!
CONFLICTING_OVERLOADS
!>
private
fun
invalidFun1
()
{}<!>
<!
CONFLICTING_OVERLOADS
!>
private
fun
invalidFun1
()
<!>
{}
<!
CONFLICTING_OVERLOADS
!>
private
fun
invalidFun1
()
<!>
{}
<!
CONFLICTING_OVERLOADS
!>
private
fun
invalidFun2
()
{}<!>
<!
CONFLICTING_OVERLOADS
!>
public
fun
invalidFun2
()
{}<!>
<!
CONFLICTING_OVERLOADS
!>
private
fun
invalidFun2
()
<!>
{}
<!
CONFLICTING_OVERLOADS
!>
public
fun
invalidFun2
()
<!>
{}
public
fun
invalidFun3
()
{}
<!
CONFLICTING_OVERLOADS
!>
private
fun
invalidFun4
()
{}<!>
<!
CONFLICTING_OVERLOADS
!>
public
fun
invalidFun4
()
{}<!>
<!
CONFLICTING_OVERLOADS
!>
private
fun
invalidFun4
()
<!>
{}
<!
CONFLICTING_OVERLOADS
!>
public
fun
invalidFun4
()
<!>
{}
public
fun
validFun2
(
a
:
A
)
=
a
public
fun
validFun2
(
b
:
B
)
=
b
...
...
compiler/testData/diagnostics/tests/redeclarations/kt470.fir.kt
浏览文件 @
f1d8a6e5
...
...
@@ -7,14 +7,14 @@
<!
REDECLARATION
!>
val
b
:
Int
=
1
<!>
<!
REDECLARATION
!>
val
b
:
Int
=
1
<!>
<!
CONFLICTING_OVERLOADS
!>
fun
foo
()
{}<!>
// and here too
<!
CONFLICTING_OVERLOADS
!>
fun
foo
()
{}<!>
// and here
<!
CONFLICTING_OVERLOADS
!>
fun
foo
()
{}<!>
// and here
<!
CONFLICTING_OVERLOADS
!>
fun
foo
()
{}<!>
// and here
<!
CONFLICTING_OVERLOADS
!>
fun
foo
()
<!>
{}
// and here too
<!
CONFLICTING_OVERLOADS
!>
fun
foo
()
<!>
{}
// and here
<!
CONFLICTING_OVERLOADS
!>
fun
foo
()
<!>
{}
// and here
<!
CONFLICTING_OVERLOADS
!>
fun
foo
()
<!>
{}
// and here
<!
CONFLICTING_OVERLOADS
!>
fun
bar
()
{}<!>
// and here
<!
CONFLICTING_OVERLOADS
!>
fun
bar
()
{}<!>
// and here
<!
CONFLICTING_OVERLOADS
!>
fun
bar
()
{}<!>
// and here
<!
CONFLICTING_OVERLOADS
!>
fun
bar
()
<!>
{}
// and here
<!
CONFLICTING_OVERLOADS
!>
fun
bar
()
<!>
{}
// and here
<!
CONFLICTING_OVERLOADS
!>
fun
bar
()
<!>
{}
// and here
class
A
{
<!
REDECLARATION
!>
val
a
:
Int
=
1
<!>
...
...
@@ -26,12 +26,12 @@ class A {
<!
REDECLARATION
!>
val
b
:
Int
=
1
<!>
<!
REDECLARATION
!>
val
b
:
Int
=
1
<!>
<!
CONFLICTING_OVERLOADS
!>
fun
foo
()
{}<!>
// and here too
<!
CONFLICTING_OVERLOADS
!>
fun
foo
()
{}<!>
// and here
<!
CONFLICTING_OVERLOADS
!>
fun
foo
()
{}<!>
// and here
<!
CONFLICTING_OVERLOADS
!>
fun
foo
()
{}<!>
// and here
<!
CONFLICTING_OVERLOADS
!>
fun
foo
()
<!>
{}
// and here too
<!
CONFLICTING_OVERLOADS
!>
fun
foo
()
<!>
{}
// and here
<!
CONFLICTING_OVERLOADS
!>
fun
foo
()
<!>
{}
// and here
<!
CONFLICTING_OVERLOADS
!>
fun
foo
()
<!>
{}
// and here
<!
CONFLICTING_OVERLOADS
!>
fun
bar
()
{}<!>
// and here
<!
CONFLICTING_OVERLOADS
!>
fun
bar
()
{}<!>
// and here
<!
CONFLICTING_OVERLOADS
!>
fun
bar
()
{}<!>
// and here
<!
CONFLICTING_OVERLOADS
!>
fun
bar
()
<!>
{}
// and here
<!
CONFLICTING_OVERLOADS
!>
fun
bar
()
<!>
{}
// and here
<!
CONFLICTING_OVERLOADS
!>
fun
bar
()
<!>
{}
// and here
}
compiler/testData/diagnostics/tests/resolve/resolveWithRedeclarationError.fir.kt
浏览文件 @
f1d8a6e5
...
...
@@ -3,32 +3,32 @@ package c
fun
z
(
view
:
()
->
Unit
)
{}
<!
CONFLICTING_OVERLOADS
!>
fun
x
()
=
z
{
z
{
z
{
z
{
z
{
z
{
z
{
z
{
}
}
}
}
}
}
}
}<!>
<!
CONFLICTING_OVERLO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}
}
}
}
}
}
<!
CONFLICTING_OVERLOADS
!>
fun
x
()
<!>
=
z
{
z
{
z
{
z
{
z
{
z
{
z
{
z
{
}
}
}
}
}
}
}
}
<!
CONFLICTING_OVERLOADS
!>
fun
x
()
<!>
=
z
{
z
{
z
{
z
{
z
{
z
{
z
{
z
{
}
}
}
}
}
}
}
}
<!
CONFLICTING_OVERLOADS
!>
fun
x
()
<!>
=
z
{
z
{
z
{
z
{
z
{
z
{
z
{
z
{
}
}
}
}
}
}
}
}
class
x() {}
\ No newline at end of file
compiler/testData/diagnostics/testsWithStdLib/coroutines/suspendConflictsWithNoSuspend.fir.kt
浏览文件 @
f1d8a6e5
...
...
@@ -5,11 +5,11 @@ interface A {
}
interface
B
:
A
{
<!
CONFLICTING_OVERLOADS
!>
suspend
override
fun
foo
()
{
<!
CONFLICTING_OVERLOADS
!>
suspend
override
fun
foo
()
<!>
{
}
<!>
}
<!
CONFLICTING_OVERLOADS
!>
override
fun
foo
()
{
<!
CONFLICTING_OVERLOADS
!>
override
fun
foo
()
<!>
{
}
<!>
}
}
compiler/testData/diagnostics/testsWithStdLib/inference/annotationsForResolve/noInferAndLowPriority.fir.kt
浏览文件 @
f1d8a6e5
...
...
@@ -4,10 +4,10 @@
<!
CONFLICTING_OVERLOADS
!>
@Suppress
(
"INVISIBLE_MEMBER"
,
"INVISIBLE_REFERENCE"
)
@
kotlin
.
jvm
.
JvmName
(
"containsAny"
)
<!
HIDDEN
!>
@
kotlin
.
internal
.
LowPriorityInOverloadResolution
<
!
>
public
fun
<
T
>
Iterable
<
T
>.
contains1
(
element
:
T
):
Int
=
null
!!
<!>
public
fun
<
T
>
Iterable
<
T
>.
contains1
(
element
:
T
):
Int
<
!
>
=
null
!!
<!
CONFLICTING_OVERLOADS
!>
@Suppress
(
"INVISIBLE_MEMBER"
,
"INVISIBLE_REFERENCE"
)
public
fun
<
T
>
Iterable
<
T
>.
contains1
(
element
:
@
kotlin
.
internal
.
NoInfer
T
):
Boolean
=
null
!!
<!>
public
fun
<
T
>
Iterable
<
T
>.
contains1
(
element
:
@
kotlin
.
internal
.
NoInfer
T
):
Boolean
<
!
>
=
null
!!
fun
test
()
{
...
...
compiler/testData/diagnostics/testsWithStdLib/inference/annotationsForResolve/onlyInputTypesAndLowPriority.fir.kt
浏览文件 @
f1d8a6e5
...
...
@@ -5,10 +5,10 @@
<!
CONFLICTING_OVERLOADS
!>
@Suppress
(
"INVISIBLE_MEMBER"
,
"INVISIBLE_REFERENCE"
)
@
kotlin
.
jvm
.
JvmName
(
"containsAny"
)
<!
HIDDEN
!>
@
kotlin
.
internal
.
LowPriorityInOverloadResolution
<
!
>
public
fun
<
T
>
Iterable
<
T
>.
contains1
(
element
:
T
):
Int
=
null
!!
<!>
public
fun
<
T
>
Iterable
<
T
>.
contains1
(
element
:
T
):
Int
<
!
>
=
null
!!
<!
CONFLICTING_OVERLOADS
!>
@Suppress
(
"INVISIBLE_MEMBER"
,
"INVISIBLE_REFERENCE"
)
public
fun
<<
!
HIDDEN
!
>
@kotl
in
.
in
ternal.
OnlyInputTypes
<
!
>
T
>
Iterable
<
T
>.
contains1
(
element
:
T
):
Boolean
=
null
!!
<!>
public
fun
<<
!
HIDDEN
!
>
@kotl
in
.
in
ternal.
OnlyInputTypes
<
!
>
T
>
Iterable
<
T
>.
contains1
(
element
:
T
):
Boolean
<
!
>
=
null
!!
@Suppress
(
"INVISIBLE_MEMBER"
,
"INVISIBLE_REFERENCE"
)
@JvmName
(
"getAny"
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录