Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dokka can't find return type function with expression body and omitted return type #79

Closed
ghost opened this issue May 26, 2016 · 4 comments
Labels
Milestone

Comments

@ghost
Copy link

ghost commented May 26, 2016

If a class exists with functions where an expression body is used and also the return type is omitted, Dokka sometimes is unable to find the return type.

It seems that the return type can't be resolved as soon as generic methods of the kotlin-stdlib are used.

For example for every function class starting with the name broken the return type can't be resolved:

package com.github.porokoro.example

data 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"
}

This results in warnings about unresolved types during generation and creates <ERROR CLASS> entries in the documentation. I attached a screenshot of the resulting documentation:

Documentation error types

@yole
Copy link
Contributor

yole commented Jun 30, 2016

How exactly are you invoking Dokka?

@semoro semoro added the bug label Nov 3, 2016
semoro added a commit that referenced this issue Nov 8, 2016
semoro added a commit that referenced this issue Nov 8, 2016
Fix for GH-79 , KT-13299  Critical bug, top-level Kotlin functions from libraries not resolved
@semoro
Copy link
Contributor

semoro commented Nov 8, 2016

Fixed in PR #110

@semoro semoro closed this as completed Nov 8, 2016
@joshfriend
Copy link

Is this the reason that a ton of the generic methods in the docs of kotlin.collections show up as receiving or returning <ERROR CLASS>?

@semoro
Copy link
Contributor

semoro commented Nov 28, 2016

@joshfriend
Not sure, but this issue also resolved in dokka 0.9.10

@semoro semoro added this to the 0.9.10 milestone Nov 29, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants