Skip to content

Trouble in kotlin to show types with generics correctly #69

@yluom

Description

@yluom

Hello,
First, thanks for your work!

The plugins seems to have trouble handling generics with "<" and ">" in error messages.

See, this code:

  fun map(): Map<String, String> {
    // compilation problem
    return listOf(
      "whatever" to "thanks for the plugin",
    )
  }

Triggers this error :

Type mismatch.
Required: Map<String, String>
Found: List<Pair<String, String>>

But InlineProblems only show partial bugged types: "inferred type is List> but Map was expected"

Image

For this one, I expected the InlineProblems to show inferred type is List<Pair<String, String>> but Map<String, String> was expected

This is a simple exemple but I have more complex types in production like ImmutableMap<Something<Foo>, Pair<Bar, Bar>> where Inline problems are totally unreadable.

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions