Skip to content

Go-to-type is not useful for function #25933

Closed
@ghost

Description

TypeScript Version: 3.1.0-dev.20180725

Search Terms:

Code

interface I { x: number; }
function f(): I { return { x: 0 }; }

f();

Go-to-type on f().

Expected behavior:

Takes me to I.

Actual behavior:

Takes me to f -- same as go-to-definition.

Contrast with this Kotlin code:

class C(val x: Int)

fun f() = C(0)

fun main() {
    f()
}

where go-to-declaration on f() takes me to the definition, but go-to-type takes me to C.

Metadata

Metadata

Assignees

No one assigned

    Labels

    FixedA PR has been merged for this issueSuggestionAn idea for TypeScript

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions