From 6abd6561168ad83fbed9c21aae23f7fd8c08052e Mon Sep 17 00:00:00 2001 From: Zalim Bashorov Date: Wed, 25 Nov 2020 22:17:32 +0300 Subject: [PATCH] [IR] dumpKotlinLike: update testdata after rebase --- ...edImplementationOfJavaInterface.fir.kt.txt | 2 + .../annotationsOnDelegatedMembers.fir.kt.txt | 4 + .../inheritingDeprecation.fir.kt.txt | 2 + .../typeVariableAfterBuildMap.fir.kt.txt | 175 ++++++++++++++++++ .../typeVariableAfterBuildMap.kt.txt | 175 ++++++++++++++++++ .../castsInsideCoroutineInference.fir.kt.txt | 4 +- 6 files changed, 360 insertions(+), 2 deletions(-) create mode 100644 compiler/testData/ir/irText/firProblems/typeVariableAfterBuildMap.fir.kt.txt create mode 100644 compiler/testData/ir/irText/firProblems/typeVariableAfterBuildMap.kt.txt diff --git a/compiler/testData/ir/irText/classes/delegatedImplementationOfJavaInterface.fir.kt.txt b/compiler/testData/ir/irText/classes/delegatedImplementationOfJavaInterface.fir.kt.txt index 99901f3782f..f8ae385e192 100644 --- a/compiler/testData/ir/irText/classes/delegatedImplementationOfJavaInterface.fir.kt.txt +++ b/compiler/testData/ir/irText/classes/delegatedImplementationOfJavaInterface.fir.kt.txt @@ -22,10 +22,12 @@ class Test : J { .#<$$delegate_0>.takeFlexible(x = x) } + @NotNull override fun returnNotNull(): @EnhancedNullability String { return .#<$$delegate_0>.returnNotNull() } + @Nullable override fun returnNullable(): @FlexibleNullability String? { return .#<$$delegate_0>.returnNullable() } diff --git a/compiler/testData/ir/irText/declarations/annotations/annotationsOnDelegatedMembers.fir.kt.txt b/compiler/testData/ir/irText/declarations/annotations/annotationsOnDelegatedMembers.fir.kt.txt index 45bfc22d9b2..d2fd97a09fd 100644 --- a/compiler/testData/ir/irText/declarations/annotations/annotationsOnDelegatedMembers.fir.kt.txt +++ b/compiler/testData/ir/irText/declarations/annotations/annotationsOnDelegatedMembers.fir.kt.txt @@ -27,19 +27,23 @@ class DFoo : IFoo { .#<$$delegate_0> = d } + @Ann override fun testFun() { .#<$$delegate_0>.testFun() } + @Ann override fun String.testExtFun() { (.#<$$delegate_0>, ).testExtFun() } + @Ann override val testVal: String override get(): String { return .#<$$delegate_0>.() } + @Ann override val String.testExtVal: String override get(): String { return (.#<$$delegate_0>, ).() diff --git a/compiler/testData/ir/irText/declarations/annotations/inheritingDeprecation.fir.kt.txt b/compiler/testData/ir/irText/declarations/annotations/inheritingDeprecation.fir.kt.txt index af0e0ee01ba..2c3ee7d7203 100644 --- a/compiler/testData/ir/irText/declarations/annotations/inheritingDeprecation.fir.kt.txt +++ b/compiler/testData/ir/irText/declarations/annotations/inheritingDeprecation.fir.kt.txt @@ -21,11 +21,13 @@ class Delegated : IFoo { .#<$$delegate_0> = foo } + @Deprecated(message = "") override val prop: String override get(): String { return .#<$$delegate_0>.() } + @Deprecated(message = "") override val String.extProp: String override get(): String { return (.#<$$delegate_0>, ).() diff --git a/compiler/testData/ir/irText/firProblems/typeVariableAfterBuildMap.fir.kt.txt b/compiler/testData/ir/irText/firProblems/typeVariableAfterBuildMap.fir.kt.txt new file mode 100644 index 00000000000..cecf37e0998 --- /dev/null +++ b/compiler/testData/ir/irText/firProblems/typeVariableAfterBuildMap.fir.kt.txt @@ -0,0 +1,175 @@ +abstract class Visibility { + constructor(name: String, isPublicAPI: Boolean) /* primary */ { + super/*Any*/() + /* () */ + + } + + val name: String + field = name + get + + val isPublicAPI: Boolean + field = isPublicAPI + get + + open val internalDisplayName: String + open get(): String { + return .() + } + + open val externalDisplayName: String + open get(): String { + return .() + } + + abstract fun mustCheckInImports(): Boolean + +} + +object Visibilities { + private constructor() /* primary */ { + super/*Any*/() + /* () */ + + } + + object Private : Visibility { + private constructor() /* primary */ { + super/*Visibility*/(name = "private", isPublicAPI = false) + /* () */ + + } + + override fun mustCheckInImports(): Boolean { + return true + } + + } + + object PrivateToThis : Visibility { + private constructor() /* primary */ { + super/*Visibility*/(name = "private_to_this", isPublicAPI = false) + /* () */ + + } + + override val internalDisplayName: String + override get(): String { + return "private/*private to this*/" + } + + override fun mustCheckInImports(): Boolean { + return true + } + + } + + object Protected : Visibility { + private constructor() /* primary */ { + super/*Visibility*/(name = "protected", isPublicAPI = true) + /* () */ + + } + + override fun mustCheckInImports(): Boolean { + return false + } + + } + + object Internal : Visibility { + private constructor() /* primary */ { + super/*Visibility*/(name = "internal", isPublicAPI = false) + /* () */ + + } + + override fun mustCheckInImports(): Boolean { + return true + } + + } + + object Public : Visibility { + private constructor() /* primary */ { + super/*Visibility*/(name = "public", isPublicAPI = true) + /* () */ + + } + + override fun mustCheckInImports(): Boolean { + return false + } + + } + + object Local : Visibility { + private constructor() /* primary */ { + super/*Visibility*/(name = "local", isPublicAPI = false) + /* () */ + + } + + override fun mustCheckInImports(): Boolean { + return true + } + + } + + object Inherited : Visibility { + private constructor() /* primary */ { + super/*Visibility*/(name = "inherited", isPublicAPI = false) + /* () */ + + } + + override fun mustCheckInImports(): Boolean { + throw IllegalStateException(p0 = "This method shouldn't be invoked for INHERITED visibility") + } + + } + + object InvisibleFake : Visibility { + private constructor() /* primary */ { + super/*Visibility*/(name = "invisible_fake", isPublicAPI = false) + /* () */ + + } + + override fun mustCheckInImports(): Boolean { + return true + } + + override val externalDisplayName: String + override get(): String { + return "invisible (private in a supertype)" + } + + } + + object Unknown : Visibility { + private constructor() /* primary */ { + super/*Visibility*/(name = "unknown", isPublicAPI = false) + /* () */ + + } + + override fun mustCheckInImports(): Boolean { + throw IllegalStateException(p0 = "This method shouldn't be invoked for UNKNOWN visibility") + } + + } + + private val ORDERED_VISIBILITIES: Map + field = buildMap(builderAction = local fun MutableMap.() { + .put(key = PrivateToThis, value = 0) /*~> Unit */ + .put(key = Private, value = 0) /*~> Unit */ + .put(key = Internal, value = 1) /*~> Unit */ + .put(key = Protected, value = 1) /*~> Unit */ + return .put(key = Public, value = 2) /*~> Unit */ + } +) + private get + +} diff --git a/compiler/testData/ir/irText/firProblems/typeVariableAfterBuildMap.kt.txt b/compiler/testData/ir/irText/firProblems/typeVariableAfterBuildMap.kt.txt new file mode 100644 index 00000000000..bf26d2c54dd --- /dev/null +++ b/compiler/testData/ir/irText/firProblems/typeVariableAfterBuildMap.kt.txt @@ -0,0 +1,175 @@ +abstract class Visibility { + constructor(name: String, isPublicAPI: Boolean) /* primary */ { + super/*Any*/() + /* () */ + + } + + val name: String + field = name + get + + val isPublicAPI: Boolean + field = isPublicAPI + get + + open val internalDisplayName: String + open get(): String { + return .() + } + + open val externalDisplayName: String + open get(): String { + return .() + } + + abstract fun mustCheckInImports(): Boolean + +} + +object Visibilities { + private constructor() /* primary */ { + super/*Any*/() + /* () */ + + } + + object Private : Visibility { + private constructor() /* primary */ { + super/*Visibility*/(name = "private", isPublicAPI = false) + /* () */ + + } + + override fun mustCheckInImports(): Boolean { + return true + } + + } + + object PrivateToThis : Visibility { + private constructor() /* primary */ { + super/*Visibility*/(name = "private_to_this", isPublicAPI = false) + /* () */ + + } + + override val internalDisplayName: String + override get(): String { + return "private/*private to this*/" + } + + override fun mustCheckInImports(): Boolean { + return true + } + + } + + object Protected : Visibility { + private constructor() /* primary */ { + super/*Visibility*/(name = "protected", isPublicAPI = true) + /* () */ + + } + + override fun mustCheckInImports(): Boolean { + return false + } + + } + + object Internal : Visibility { + private constructor() /* primary */ { + super/*Visibility*/(name = "internal", isPublicAPI = false) + /* () */ + + } + + override fun mustCheckInImports(): Boolean { + return true + } + + } + + object Public : Visibility { + private constructor() /* primary */ { + super/*Visibility*/(name = "public", isPublicAPI = true) + /* () */ + + } + + override fun mustCheckInImports(): Boolean { + return false + } + + } + + object Local : Visibility { + private constructor() /* primary */ { + super/*Visibility*/(name = "local", isPublicAPI = false) + /* () */ + + } + + override fun mustCheckInImports(): Boolean { + return true + } + + } + + object Inherited : Visibility { + private constructor() /* primary */ { + super/*Visibility*/(name = "inherited", isPublicAPI = false) + /* () */ + + } + + override fun mustCheckInImports(): Boolean { + throw IllegalStateException(p0 = "This method shouldn't be invoked for INHERITED visibility") + } + + } + + object InvisibleFake : Visibility { + private constructor() /* primary */ { + super/*Visibility*/(name = "invisible_fake", isPublicAPI = false) + /* () */ + + } + + override fun mustCheckInImports(): Boolean { + return true + } + + override val externalDisplayName: String + override get(): String { + return "invisible (private in a supertype)" + } + + } + + object Unknown : Visibility { + private constructor() /* primary */ { + super/*Visibility*/(name = "unknown", isPublicAPI = false) + /* () */ + + } + + override fun mustCheckInImports(): Boolean { + throw IllegalStateException(p0 = "This method shouldn't be invoked for UNKNOWN visibility") + } + + } + + private val ORDERED_VISIBILITIES: Map + field = buildMap(builderAction = local fun MutableMap.() { + $this$buildMap.put(key = PrivateToThis, value = 0) /*~> Unit */ + $this$buildMap.put(key = Private, value = 0) /*~> Unit */ + $this$buildMap.put(key = Internal, value = 1) /*~> Unit */ + $this$buildMap.put(key = Protected, value = 1) /*~> Unit */ + $this$buildMap.put(key = Public, value = 2) /*~> Unit */ + } +) + private get + +} diff --git a/compiler/testData/ir/irText/types/castsInsideCoroutineInference.fir.kt.txt b/compiler/testData/ir/irText/types/castsInsideCoroutineInference.fir.kt.txt index 5d56f89742b..6c921d41b55 100644 --- a/compiler/testData/ir/irText/types/castsInsideCoroutineInference.fir.kt.txt +++ b/compiler/testData/ir/irText/types/castsInsideCoroutineInference.fir.kt.txt @@ -3,7 +3,7 @@ fun scopedFlow(@BuilderInference block: @ExtensionFunctionType @Exten return flow(block = local suspend fun FlowCollector.() { val collector: FlowCollector = flowScope(block = local suspend fun CoroutineScope.() { - block.invoke(p1 = , p2 = collector) + block.invoke(p1 = , p2 = collector /*as FlowCollector */) } ) } @@ -12,7 +12,7 @@ fun scopedFlow(@BuilderInference block: @ExtensionFunctionType @Exten fun Flow.onCompletion(action: @ExtensionFunctionType @ExtensionFunctionType SuspendFunction2, Throwable?, Unit>): Flow { return unsafeFlow(block = local suspend fun FlowCollector.() { - val safeCollector: SafeCollector = SafeCollector(collector = ) + val safeCollector: SafeCollector = SafeCollector(collector = ) safeCollector.invokeSafely(action = action) } )