Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
硅谷海盗
kotlin
提交
6dd331d7
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,发现更多精彩内容 >>
提交
6dd331d7
编写于
2月 09, 2021
作者:
D
Dmitriy Novozhilov
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[FIR] Add tests for non exhaustive when as last expression of lambda
KT-44810
上级
e54f31cc
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
90 addition
and
0 deletion
+90
-0
compiler/fir/analysis-tests/legacy-fir-tests/tests-gen/org/jetbrains/kotlin/fir/LazyBodyIsNotTouchedTilContractsPhaseTestGenerated.java
...r/LazyBodyIsNotTouchedTilContractsPhaseTestGenerated.java
+10
-0
compiler/fir/analysis-tests/testData/resolve/exhaustiveness/negative/nonExhaustiveWhenWithoutCoercionToUnit.fir.txt
...s/negative/nonExhaustiveWhenWithoutCoercionToUnit.fir.txt
+15
-0
compiler/fir/analysis-tests/testData/resolve/exhaustiveness/negative/nonExhaustiveWhenWithoutCoercionToUnit.kt
...veness/negative/nonExhaustiveWhenWithoutCoercionToUnit.kt
+10
-0
compiler/fir/analysis-tests/testData/resolve/exhaustiveness/positive/nonExhaustiveWhenWithCoercionToUnit.fir.txt
...ness/positive/nonExhaustiveWhenWithCoercionToUnit.fir.txt
+21
-0
compiler/fir/analysis-tests/testData/resolve/exhaustiveness/positive/nonExhaustiveWhenWithCoercionToUnit.kt
...stiveness/positive/nonExhaustiveWhenWithCoercionToUnit.kt
+10
-0
compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirDiagnosticTestGenerated.java
...rains/kotlin/test/runners/FirDiagnosticTestGenerated.java
+12
-0
compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirDiagnosticsWithLightTreeTestGenerated.java
...est/runners/FirDiagnosticsWithLightTreeTestGenerated.java
+12
-0
未找到文件。
compiler/fir/analysis-tests/legacy-fir-tests/tests-gen/org/jetbrains/kotlin/fir/LazyBodyIsNotTouchedTilContractsPhaseTestGenerated.java
浏览文件 @
6dd331d7
...
...
@@ -1274,6 +1274,11 @@ public class LazyBodyIsNotTouchedTilContractsPhaseTestGenerated extends Abstract
public
void
testMissingSealedInheritor
()
throws
Exception
{
runTest
(
"compiler/fir/analysis-tests/testData/resolve/exhaustiveness/negative/missingSealedInheritor.kt"
);
}
@TestMetadata
(
"nonExhaustiveWhenWithoutCoercionToUnit.kt"
)
public
void
testNonExhaustiveWhenWithoutCoercionToUnit
()
throws
Exception
{
runTest
(
"compiler/fir/analysis-tests/testData/resolve/exhaustiveness/negative/nonExhaustiveWhenWithoutCoercionToUnit.kt"
);
}
}
@TestMetadata
(
"compiler/fir/analysis-tests/testData/resolve/exhaustiveness/positive"
)
...
...
@@ -1327,6 +1332,11 @@ public class LazyBodyIsNotTouchedTilContractsPhaseTestGenerated extends Abstract
public
void
testExhaustiveness_sealedSubClass
()
throws
Exception
{
runTest
(
"compiler/fir/analysis-tests/testData/resolve/exhaustiveness/positive/exhaustiveness_sealedSubClass.kt"
);
}
@TestMetadata
(
"nonExhaustiveWhenWithCoercionToUnit.kt"
)
public
void
testNonExhaustiveWhenWithCoercionToUnit
()
throws
Exception
{
runTest
(
"compiler/fir/analysis-tests/testData/resolve/exhaustiveness/positive/nonExhaustiveWhenWithCoercionToUnit.kt"
);
}
}
}
...
...
compiler/fir/analysis-tests/testData/resolve/exhaustiveness/negative/nonExhaustiveWhenWithoutCoercionToUnit.fir.txt
0 → 100644
浏览文件 @
6dd331d7
FILE: nonExhaustiveWhenWithoutCoercionToUnit.kt
public final fun <T> run(block: R|() -> T|): R|T| {
^run R|<local>/block|.R|SubstitutionOverride<kotlin/Function0.invoke: R|T|>|()
}
public final fun test(a: R|kotlin/Any|): R|kotlin/Unit| {
R|/run|<R|kotlin/Unit|>(<L> = run@fun <anonymous>(): R|kotlin/Unit| {
when (R|<local>/a|) {
($subj$ is R|kotlin/String|) -> {
Int(1)
}
}
}
)
}
compiler/fir/analysis-tests/testData/resolve/exhaustiveness/negative/nonExhaustiveWhenWithoutCoercionToUnit.kt
0 → 100644
浏览文件 @
6dd331d7
fun
<
T
>
run
(
block
:
()
->
T
):
T
=
block
()
fun
test
(
a
:
Any
)
{
run
{
// Should be an error, see KT-44810
when
(
a
)
{
is
String
->
1
}
}
}
compiler/fir/analysis-tests/testData/resolve/exhaustiveness/positive/nonExhaustiveWhenWithCoercionToUnit.fir.txt
0 → 100644
浏览文件 @
6dd331d7
FILE: nonExhaustiveWhenWithCoercionToUnit.kt
public final fun <T> run(block: R|() -> T|): R|T| {
^run R|<local>/block|.R|SubstitutionOverride<kotlin/Function0.invoke: R|T|>|()
}
public final fun test(a: R|kotlin/Any|, b: R|kotlin/Boolean|): R|kotlin/Unit| {
R|/run|<R|kotlin/Unit|>(<L> = run@fun <anonymous>(): R|kotlin/Unit| {
when () {
R|<local>/b| -> {
^@run Unit
}
}
when (R|<local>/a|) {
($subj$ is R|kotlin/String|) -> {
Int(1)
}
}
}
)
}
compiler/fir/analysis-tests/testData/resolve/exhaustiveness/positive/nonExhaustiveWhenWithCoercionToUnit.kt
0 → 100644
浏览文件 @
6dd331d7
fun
<
T
>
run
(
block
:
()
->
T
):
T
=
block
()
fun
test
(
a
:
Any
,
b
:
Boolean
)
{
run
{
if
(
b
)
return
@run
when
(
a
)
{
is
String
->
1
}
}
}
compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirDiagnosticTestGenerated.java
浏览文件 @
6dd331d7
...
...
@@ -1459,6 +1459,12 @@ public class FirDiagnosticTestGenerated extends AbstractFirDiagnosticTest {
public
void
testMissingSealedInheritor
()
throws
Exception
{
runTest
(
"compiler/fir/analysis-tests/testData/resolve/exhaustiveness/negative/missingSealedInheritor.kt"
);
}
@Test
@TestMetadata
(
"nonExhaustiveWhenWithoutCoercionToUnit.kt"
)
public
void
testNonExhaustiveWhenWithoutCoercionToUnit
()
throws
Exception
{
runTest
(
"compiler/fir/analysis-tests/testData/resolve/exhaustiveness/negative/nonExhaustiveWhenWithoutCoercionToUnit.kt"
);
}
}
@Nested
...
...
@@ -1517,6 +1523,12 @@ public class FirDiagnosticTestGenerated extends AbstractFirDiagnosticTest {
public
void
testExhaustiveness_sealedSubClass
()
throws
Exception
{
runTest
(
"compiler/fir/analysis-tests/testData/resolve/exhaustiveness/positive/exhaustiveness_sealedSubClass.kt"
);
}
@Test
@TestMetadata
(
"nonExhaustiveWhenWithCoercionToUnit.kt"
)
public
void
testNonExhaustiveWhenWithCoercionToUnit
()
throws
Exception
{
runTest
(
"compiler/fir/analysis-tests/testData/resolve/exhaustiveness/positive/nonExhaustiveWhenWithCoercionToUnit.kt"
);
}
}
}
...
...
compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirDiagnosticsWithLightTreeTestGenerated.java
浏览文件 @
6dd331d7
...
...
@@ -1473,6 +1473,12 @@ public class FirDiagnosticsWithLightTreeTestGenerated extends AbstractFirDiagnos
public
void
testMissingSealedInheritor
()
throws
Exception
{
runTest
(
"compiler/fir/analysis-tests/testData/resolve/exhaustiveness/negative/missingSealedInheritor.kt"
);
}
@Test
@TestMetadata
(
"nonExhaustiveWhenWithoutCoercionToUnit.kt"
)
public
void
testNonExhaustiveWhenWithoutCoercionToUnit
()
throws
Exception
{
runTest
(
"compiler/fir/analysis-tests/testData/resolve/exhaustiveness/negative/nonExhaustiveWhenWithoutCoercionToUnit.kt"
);
}
}
@Nested
...
...
@@ -1532,6 +1538,12 @@ public class FirDiagnosticsWithLightTreeTestGenerated extends AbstractFirDiagnos
public
void
testExhaustiveness_sealedSubClass
()
throws
Exception
{
runTest
(
"compiler/fir/analysis-tests/testData/resolve/exhaustiveness/positive/exhaustiveness_sealedSubClass.kt"
);
}
@Test
@TestMetadata
(
"nonExhaustiveWhenWithCoercionToUnit.kt"
)
public
void
testNonExhaustiveWhenWithCoercionToUnit
()
throws
Exception
{
runTest
(
"compiler/fir/analysis-tests/testData/resolve/exhaustiveness/positive/nonExhaustiveWhenWithCoercionToUnit.kt"
);
}
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录