-
Notifications
You must be signed in to change notification settings - Fork 411
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Fix for GH-79 , KT-13299 Critical bug, top-level Kotlin functions from libraries not resolved
- Loading branch information
Showing
3 changed files
with
51 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
package issues | ||
|
||
import org.jetbrains.dokka.DocumentationNode | ||
import org.jetbrains.dokka.NodeKind | ||
import org.jetbrains.dokka.tests.toTestString | ||
import org.jetbrains.dokka.tests.verifyModel | ||
import org.junit.Test | ||
import kotlin.test.assertEquals | ||
|
||
|
||
class IssuesTest { | ||
|
||
@Test | ||
fun errorClasses() { | ||
verifyModel("testdata/issues/errorClasses.kt", withJdk = true, withKotlinRuntime = true) { model -> | ||
val cls = model.members.single().members.single() | ||
|
||
fun DocumentationNode.returnType() = this.details.find { it.kind == NodeKind.Type }?.name | ||
assertEquals("Test", cls.members[1].returnType()) | ||
assertEquals("Test", cls.members[2].returnType()) | ||
assertEquals("Test", cls.members[3].returnType()) | ||
assertEquals("List", cls.members[4].returnType()) | ||
assertEquals("String", cls.members[5].returnType()) | ||
assertEquals("String", cls.members[6].returnType()) | ||
assertEquals("String", cls.members[7].returnType()) | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
|
||
class Test(var value: String) { | ||
fun brokenApply(v: String) = apply { value = v } | ||
|
||
fun brokenRun(v: String) = run { | ||
value = v | ||
this | ||
} | ||
|
||
fun brokenLet(v: String) = let { | ||
it.value = v | ||
it | ||
} | ||
|
||
fun brokenGenerics() = listOf("a", "b", "c") | ||
|
||
fun working(v: String) = doSomething() | ||
|
||
fun doSomething(): String = "Hello" | ||
} |