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

Type MutableList gets converted to List #482

Closed
mc-lovin opened this issue Sep 23, 2018 · 2 comments
Closed

Type MutableList gets converted to List #482

mc-lovin opened this issue Sep 23, 2018 · 2 comments

Comments

@mc-lovin
Copy link
Contributor

When I trying to use MutableList class, it sometimes gets converted to just List

example

    val funSpec = FunSpec.constructorBuilder()
        .addParameter("list", MutableList::class.parameterizedBy(Int::class))
        .build()

gets converted to

constructor(list: kotlin.collections.List<kotlin.Int>)

while it should be

constructor(list: MutableList<kotlin.Int>)
@JakeWharton
Copy link
Collaborator

There's no such type as MutableList at runtime so the library only sees the runtime type. If you need MutableList then you'll need to use a ClassName to create it.

@Egorand
Copy link
Collaborator

Egorand commented Sep 26, 2018

Dupe of #279

@Egorand Egorand closed this as completed Sep 26, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants