Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
硅谷海盗
kotlin
提交
2ad4824e
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,发现更多精彩内容 >>
提交
2ad4824e
编写于
12月 08, 2020
作者:
M
Mikhail Zarechenskiy
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fix exception on resolving collection literal inside lambda
#KT-31907 Fixed #EA-90906 Fixed
上级
c5015c92
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
37 addition
and
2 deletion
+37
-2
compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/fir/FirOldFrontendDiagnosticsTestGenerated.java
...ns/kotlin/fir/FirOldFrontendDiagnosticsTestGenerated.java
+5
-0
compiler/frontend/src/org/jetbrains/kotlin/resolve/CollectionLiteralResolver.kt
...org/jetbrains/kotlin/resolve/CollectionLiteralResolver.kt
+2
-2
compiler/testData/diagnostics/tests/regressions/resolveCollectionLiteralInsideLambda.fir.kt
...s/regressions/resolveCollectionLiteralInsideLambda.fir.kt
+7
-0
compiler/testData/diagnostics/tests/regressions/resolveCollectionLiteralInsideLambda.kt
...tests/regressions/resolveCollectionLiteralInsideLambda.kt
+7
-0
compiler/testData/diagnostics/tests/regressions/resolveCollectionLiteralInsideLambda.txt
...ests/regressions/resolveCollectionLiteralInsideLambda.txt
+6
-0
compiler/tests-gen/org/jetbrains/kotlin/checkers/DiagnosticsTestGenerated.java
...g/jetbrains/kotlin/checkers/DiagnosticsTestGenerated.java
+5
-0
compiler/tests-gen/org/jetbrains/kotlin/checkers/javac/DiagnosticsUsingJavacTestGenerated.java
...in/checkers/javac/DiagnosticsUsingJavacTestGenerated.java
+5
-0
未找到文件。
compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/fir/FirOldFrontendDiagnosticsTestGenerated.java
浏览文件 @
2ad4824e
...
...
@@ -19071,6 +19071,11 @@ public class FirOldFrontendDiagnosticsTestGenerated extends AbstractFirOldFronte
runTest("compiler/testData/diagnostics/tests/regressions/propertyWithExtensionTypeInvoke.kt");
}
@TestMetadata("resolveCollectionLiteralInsideLambda.kt")
public void testResolveCollectionLiteralInsideLambda() throws Exception {
runTest("compiler/testData/diagnostics/tests/regressions/resolveCollectionLiteralInsideLambda.kt");
}
@TestMetadata("resolveSubclassOfList.kt")
public void testResolveSubclassOfList() throws Exception {
runTest("compiler/testData/diagnostics/tests/regressions/resolveSubclassOfList.kt");
compiler/frontend/src/org/jetbrains/kotlin/resolve/CollectionLiteralResolver.kt
浏览文件 @
2ad4824e
...
...
@@ -23,7 +23,7 @@ import org.jetbrains.kotlin.resolve.BindingContext.COLLECTION_LITERAL_CALL
import
org.jetbrains.kotlin.resolve.calls.CallResolver
import
org.jetbrains.kotlin.resolve.calls.util.CallMaker
import
org.jetbrains.kotlin.types.KotlinType
import
org.jetbrains.kotlin.types.TypeUtils
.NO_EXPECTED_TYPE
import
org.jetbrains.kotlin.types.TypeUtils
import
org.jetbrains.kotlin.types.expressions.ExpressionTypingContext
import
org.jetbrains.kotlin.types.expressions.KotlinTypeInfo
import
org.jetbrains.kotlin.types.expressions.typeInfoFactory.createTypeInfo
...
...
@@ -94,7 +94,7 @@ class CollectionLiteralResolver(
}
private
fun
getArrayFunctionCallName
(
expectedType
:
KotlinType
):
Name
{
if
(
NO_EXPECTED_TYPE
===
expectedType
||
if
(
TypeUtils
.
noExpectedType
(
expectedType
)
||
!(
KotlinBuiltIns
.
isPrimitiveArray
(
expectedType
)
||
KotlinBuiltIns
.
isUnsignedArrayType
(
expectedType
))
)
{
return
ArrayFqNames
.
ARRAY_OF_FUNCTION
...
...
compiler/testData/diagnostics/tests/regressions/resolveCollectionLiteralInsideLambda.fir.kt
0 → 100644
浏览文件 @
2ad4824e
// !DIAGNOSTICS: -UNUSED_PARAMETER
fun
foo
(
l
:
()
->
Unit
)
{}
fun
bar
(
l
:
()
->
String
)
{}
val
a
=
foo
{
[]
}
val
b
=
bar
{
[]
}
\ No newline at end of file
compiler/testData/diagnostics/tests/regressions/resolveCollectionLiteralInsideLambda.kt
0 → 100644
浏览文件 @
2ad4824e
// !DIAGNOSTICS: -UNUSED_PARAMETER
fun
foo
(
l
:
()
->
Unit
)
{}
fun
bar
(
l
:
()
->
String
)
{}
val
a
=
foo
{
<!
NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER
,
UNSUPPORTED
!>[]<!>
}
val
b
=
bar
{
<!
TYPE_MISMATCH
,
TYPE_MISMATCH
,
TYPE_MISMATCH
,
UNSUPPORTED
!>[]<!>
}
\ No newline at end of file
compiler/testData/diagnostics/tests/regressions/resolveCollectionLiteralInsideLambda.txt
0 → 100644
浏览文件 @
2ad4824e
package
public val a: kotlin.Unit
public val b: kotlin.Unit
public fun bar(/*0*/ l: () -> kotlin.String): kotlin.Unit
public fun foo(/*0*/ l: () -> kotlin.Unit): kotlin.Unit
compiler/tests-gen/org/jetbrains/kotlin/checkers/DiagnosticsTestGenerated.java
浏览文件 @
2ad4824e
...
...
@@ -19083,6 +19083,11 @@ public class DiagnosticsTestGenerated extends AbstractDiagnosticsTestWithFirVali
runTest("compiler/testData/diagnostics/tests/regressions/propertyWithExtensionTypeInvoke.kt");
}
@TestMetadata("resolveCollectionLiteralInsideLambda.kt")
public void testResolveCollectionLiteralInsideLambda() throws Exception {
runTest("compiler/testData/diagnostics/tests/regressions/resolveCollectionLiteralInsideLambda.kt");
}
@TestMetadata("resolveSubclassOfList.kt")
public void testResolveSubclassOfList() throws Exception {
runTest("compiler/testData/diagnostics/tests/regressions/resolveSubclassOfList.kt");
compiler/tests-gen/org/jetbrains/kotlin/checkers/javac/DiagnosticsUsingJavacTestGenerated.java
浏览文件 @
2ad4824e
...
...
@@ -19073,6 +19073,11 @@ public class DiagnosticsUsingJavacTestGenerated extends AbstractDiagnosticsUsing
runTest("compiler/testData/diagnostics/tests/regressions/propertyWithExtensionTypeInvoke.kt");
}
@TestMetadata("resolveCollectionLiteralInsideLambda.kt")
public void testResolveCollectionLiteralInsideLambda() throws Exception {
runTest("compiler/testData/diagnostics/tests/regressions/resolveCollectionLiteralInsideLambda.kt");
}
@TestMetadata("resolveSubclassOfList.kt")
public void testResolveSubclassOfList() throws Exception {
runTest("compiler/testData/diagnostics/tests/regressions/resolveSubclassOfList.kt");
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录