Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
硅谷海盗
kotlin
提交
2b088f11
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,发现更多精彩内容 >>
提交
2b088f11
编写于
2月 08, 2021
作者:
D
Dmitriy Novozhilov
提交者:
TeamCityServer
2月 09, 2021
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[FIR] Fix generating data class if there is non-property in primary constructor
#KT-44554 Fixed
上级
30b5bfe7
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
41 addition
and
4 deletion
+41
-4
compiler/fir/analysis-tests/legacy-fir-tests/tests-gen/org/jetbrains/kotlin/fir/LazyBodyIsNotTouchedTilContractsPhaseTestGenerated.java
...r/LazyBodyIsNotTouchedTilContractsPhaseTestGenerated.java
+5
-0
compiler/fir/analysis-tests/testData/resolve/incorrectDataClass.fir.txt
...nalysis-tests/testData/resolve/incorrectDataClass.fir.txt
+17
-0
compiler/fir/analysis-tests/testData/resolve/incorrectDataClass.kt
...fir/analysis-tests/testData/resolve/incorrectDataClass.kt
+5
-0
compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirDiagnosticTestGenerated.java
...rains/kotlin/test/runners/FirDiagnosticTestGenerated.java
+6
-0
compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirDiagnosticsWithLightTreeTestGenerated.java
...est/runners/FirDiagnosticsWithLightTreeTestGenerated.java
+6
-0
compiler/fir/raw-fir/psi2fir/src/org/jetbrains/kotlin/fir/builder/RawFirBuilder.kt
...fir/src/org/jetbrains/kotlin/fir/builder/RawFirBuilder.kt
+2
-4
未找到文件。
compiler/fir/analysis-tests/legacy-fir-tests/tests-gen/org/jetbrains/kotlin/fir/LazyBodyIsNotTouchedTilContractsPhaseTestGenerated.java
浏览文件 @
2b088f11
...
@@ -244,6 +244,11 @@ public class LazyBodyIsNotTouchedTilContractsPhaseTestGenerated extends Abstract
...
@@ -244,6 +244,11 @@ public class LazyBodyIsNotTouchedTilContractsPhaseTestGenerated extends Abstract
runTest
(
"compiler/fir/analysis-tests/testData/resolve/implicitTypeInFakeOverride.kt"
);
runTest
(
"compiler/fir/analysis-tests/testData/resolve/implicitTypeInFakeOverride.kt"
);
}
}
@TestMetadata
(
"incorrectDataClass.kt"
)
public
void
testIncorrectDataClass
()
throws
Exception
{
runTest
(
"compiler/fir/analysis-tests/testData/resolve/incorrectDataClass.kt"
);
}
@TestMetadata
(
"incorrectSuperCall.kt"
)
@TestMetadata
(
"incorrectSuperCall.kt"
)
public
void
testIncorrectSuperCall
()
throws
Exception
{
public
void
testIncorrectSuperCall
()
throws
Exception
{
runTest
(
"compiler/fir/analysis-tests/testData/resolve/incorrectSuperCall.kt"
);
runTest
(
"compiler/fir/analysis-tests/testData/resolve/incorrectSuperCall.kt"
);
...
...
compiler/fir/analysis-tests/testData/resolve/incorrectDataClass.fir.txt
0 → 100644
浏览文件 @
2b088f11
FILE: incorrectDataClass.kt
public final data class Foo : R|kotlin/Any| {
public constructor(a: R|kotlin/Int|, b: R|kotlin/Int|): R|Foo| {
super<R|kotlin/Any|>()
}
public final val b: R|kotlin/Int| = R|<local>/b|
public get(): R|kotlin/Int|
public final val c: R|kotlin/Int| = Int(4)
public get(): R|kotlin/Int|
public final operator fun component1(): R|kotlin/Int|
public final fun copy(b: R|kotlin/Int| = this@R|/Foo|.R|/Foo.b|): R|Foo|
}
compiler/fir/analysis-tests/testData/resolve/incorrectDataClass.kt
0 → 100644
浏览文件 @
2b088f11
// ISSUE: KT-44554
data class
Foo
(
a
:
Int
,
val
b
:
Int
)
{
val
c
=
4
}
compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirDiagnosticTestGenerated.java
浏览文件 @
2b088f11
...
@@ -284,6 +284,12 @@ public class FirDiagnosticTestGenerated extends AbstractFirDiagnosticTest {
...
@@ -284,6 +284,12 @@ public class FirDiagnosticTestGenerated extends AbstractFirDiagnosticTest {
runTest
(
"compiler/fir/analysis-tests/testData/resolve/implicitTypeInFakeOverride.kt"
);
runTest
(
"compiler/fir/analysis-tests/testData/resolve/implicitTypeInFakeOverride.kt"
);
}
}
@Test
@TestMetadata
(
"incorrectDataClass.kt"
)
public
void
testIncorrectDataClass
()
throws
Exception
{
runTest
(
"compiler/fir/analysis-tests/testData/resolve/incorrectDataClass.kt"
);
}
@Test
@Test
@TestMetadata
(
"incorrectSuperCall.kt"
)
@TestMetadata
(
"incorrectSuperCall.kt"
)
public
void
testIncorrectSuperCall
()
throws
Exception
{
public
void
testIncorrectSuperCall
()
throws
Exception
{
...
...
compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirDiagnosticsWithLightTreeTestGenerated.java
浏览文件 @
2b088f11
...
@@ -287,6 +287,12 @@ public class FirDiagnosticsWithLightTreeTestGenerated extends AbstractFirDiagnos
...
@@ -287,6 +287,12 @@ public class FirDiagnosticsWithLightTreeTestGenerated extends AbstractFirDiagnos
runTest
(
"compiler/fir/analysis-tests/testData/resolve/implicitTypeInFakeOverride.kt"
);
runTest
(
"compiler/fir/analysis-tests/testData/resolve/implicitTypeInFakeOverride.kt"
);
}
}
@Test
@TestMetadata
(
"incorrectDataClass.kt"
)
public
void
testIncorrectDataClass
()
throws
Exception
{
runTest
(
"compiler/fir/analysis-tests/testData/resolve/incorrectDataClass.kt"
);
}
@Test
@Test
@TestMetadata
(
"incorrectSuperCall.kt"
)
@TestMetadata
(
"incorrectSuperCall.kt"
)
public
void
testIncorrectSuperCall
()
throws
Exception
{
public
void
testIncorrectSuperCall
()
throws
Exception
{
...
...
compiler/fir/raw-fir/psi2fir/src/org/jetbrains/kotlin/fir/builder/RawFirBuilder.kt
浏览文件 @
2b088f11
...
@@ -862,9 +862,7 @@ class RawFirBuilder(
...
@@ -862,9 +862,7 @@ class RawFirBuilder(
}
}
if
(
classOrObject
.
hasModifier
(
DATA_KEYWORD
)
&&
firPrimaryConstructor
!=
null
)
{
if
(
classOrObject
.
hasModifier
(
DATA_KEYWORD
)
&&
firPrimaryConstructor
!=
null
)
{
val
zippedParameters
=
classOrObject
.
primaryConstructorParameters
.
zip
(
val
zippedParameters
=
classOrObject
.
primaryConstructorParameters
.
filter
{
it
.
hasValOrVar
()
}
zip
declarations
.
filterIsInstance
<
FirProperty
>()
declarations
.
filterIsInstance
<
FirProperty
>(),
)
DataClassMembersGenerator
(
DataClassMembersGenerator
(
baseSession
,
baseSession
,
classOrObject
,
classOrObject
,
...
@@ -877,7 +875,7 @@ class RawFirBuilder(
...
@@ -877,7 +875,7 @@ class RawFirBuilder(
// just making a shallow copy isn't enough type ref may be a function type ref
// just making a shallow copy isn't enough type ref may be a function type ref
// and contain value parameters inside
// and contain value parameters inside
withDefaultSourceElementKind
(
newKind
)
{
withDefaultSourceElementKind
(
newKind
)
{
(
property
.
returnTypeRef
.
psi
as
KtTypeReference
).
toFirOrImplicitType
()
(
property
.
returnTypeRef
.
psi
as
KtTypeReference
?
).
toFirOrImplicitType
()
}
}
},
},
).
generate
()
).
generate
()
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录