diff --git a/compiler/testData/diagnostics/tests/imports/ImportFromRootPackage.kt b/compiler/testData/diagnostics/tests/imports/ImportFromRootPackage.kt index 04e63b34db7..db84d03504d 100644 --- a/compiler/testData/diagnostics/tests/imports/ImportFromRootPackage.kt +++ b/compiler/testData/diagnostics/tests/imports/ImportFromRootPackage.kt @@ -1,7 +1,10 @@ // FILE: rootPackage.kt class Klass { + class Nested } +class NotImported + fun function() = "" val property = "" @@ -16,6 +19,7 @@ fun foo(): Klass { package pkg import Klass +import Klass.Nested import function import property @@ -23,3 +27,6 @@ fun foo(): Klass { function() + property return Klass() } + +val v: Nested = Nested() +val x: NotImported = NotImported() \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/imports/ImportFromRootPackage.txt b/compiler/testData/diagnostics/tests/imports/ImportFromRootPackage.txt index 694d19bbefd..840c4287e6a 100644 --- a/compiler/testData/diagnostics/tests/imports/ImportFromRootPackage.txt +++ b/compiler/testData/diagnostics/tests/imports/ImportFromRootPackage.txt @@ -9,8 +9,24 @@ internal final class Klass { public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String + + internal final class Nested { + public constructor Nested() + public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean + public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int + public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String + } +} + +internal final class NotImported { + public constructor NotImported() + public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean + public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int + public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String } package pkg { + internal val v: Klass.Nested + internal val x: [ERROR : NotImported] internal fun foo(): Klass } diff --git a/compiler/testData/diagnostics/tests/imports/ImportHidingDefinitionInTheSameFile.kt b/compiler/testData/diagnostics/tests/imports/ImportHidingDefinitionInTheSameFile.kt index c9bc3001b8a..2c71a864ec9 100644 --- a/compiler/testData/diagnostics/tests/imports/ImportHidingDefinitionInTheSameFile.kt +++ b/compiler/testData/diagnostics/tests/imports/ImportHidingDefinitionInTheSameFile.kt @@ -1,3 +1,4 @@ +// ResolveSession.resolveToDescriptor used to crash on such code, so we just check that it's ok now import kotlin.Double import kotlin.List import kotlin.arrayOfNulls diff --git a/compiler/testData/diagnostics/tests/imports/ImportProtectedClass.kt b/compiler/testData/diagnostics/tests/imports/ImportProtectedClass.kt index aff11271935..a23df5b740a 100644 --- a/compiler/testData/diagnostics/tests/imports/ImportProtectedClass.kt +++ b/compiler/testData/diagnostics/tests/imports/ImportProtectedClass.kt @@ -10,4 +10,5 @@ class Bar: Foo() { fun foo(): Nested? = null } -fun foo(): Nested? = null \ No newline at end of file +fun foo(): Nested? = null +fun bar(): p.Foo.Nested? = null \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/imports/ImportProtectedClass.txt b/compiler/testData/diagnostics/tests/imports/ImportProtectedClass.txt index 5e5895f1473..fd2b67ab70c 100644 --- a/compiler/testData/diagnostics/tests/imports/ImportProtectedClass.txt +++ b/compiler/testData/diagnostics/tests/imports/ImportProtectedClass.txt @@ -1,6 +1,7 @@ package package p { + internal fun bar(): p.Foo.Nested? internal fun foo(): p.Foo.Nested? internal final class Bar : p.Foo { diff --git a/compiler/testData/diagnostics/tests/imports/JavaPackageLocalClassNotImported.kt b/compiler/testData/diagnostics/tests/imports/JavaPackageLocalClassNotImported.kt index ecab86a2d5a..2f5ae2cce98 100644 --- a/compiler/testData/diagnostics/tests/imports/JavaPackageLocalClassNotImported.kt +++ b/compiler/testData/diagnostics/tests/imports/JavaPackageLocalClassNotImported.kt @@ -6,7 +6,7 @@ public open class InetAddressImpl // FILE: Main.kt package a -import java.net.* +import java.net.* // should not import java.net.InetAddressImpl because it's package local import pack.* -class X : InetAddressImpl() +class X : InetAddressImpl() // should resolve to our pack.InetAddressImpl