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

Kotlin's immutable lists compile-time error #56

Open
ghost opened this issue Feb 18, 2017 · 2 comments
Open

Kotlin's immutable lists compile-time error #56

ghost opened this issue Feb 18, 2017 · 2 comments
Labels
Milestone

Comments

@ghost
Copy link

ghost commented Feb 18, 2017

I get such error:

error: no suitable method found for add(Replica)
        value.parts.add(v);
                   ^
    method Collection.add(CAP#1) is not applicable
      (argument mismatch; Replica cannot be converted to CAP#1)
    method List.add(CAP#1) is not applicable
      (argument mismatch; Replica cannot be converted to CAP#1)
  where CAP#1 is a fresh type-variable:
    CAP#1 extends Part from capture of ? extends Part

for such var:
var parts: List<Part>

@sockeqwe sockeqwe added the bug label Feb 19, 2017
@sockeqwe sockeqwe added this to the 1.0 milestone Feb 19, 2017
@svedie
Copy link

svedie commented Jan 12, 2019

@alexandr2levin You can use

var accounts: MutableList<Account> = mutableListOf()

This works.

@sockeqwe
Copy link
Contributor

sockeqwe commented Jan 13, 2019 via email

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

2 participants