Skip to content

Conversation

@crayfish1975
Copy link

@crayfish1975 crayfish1975 commented Sep 15, 2024

Что я вообще наделал? Я не понял как я сделал это дз. Если это возможно, можно пожалуйста объяснить почему при добавлении приставки "private" к переменной errors во втором задании, исчезает ошибка (Type parameter E is declared as 'in' but occurs in 'invariant' position in type MutableList<Pair<LocalDateTime, E>>)?
И зачем вообще в определении переменной (val errors = mutableListOf<Pair<LocalDateTime, E>>()) нужен "E", если его можно заменить на "Throwable", и все будет работать, и даже без "private"?

}
}

fun dump(): List<Pair<LocalDateTime, Throwable>> = errors
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@crayfish1975 , не совсем верно. Должно быть:

fun dump(): List<Pair<LocalDateTime, E>>

@crayfish1975
Copy link
Author

crayfish1975 commented Sep 16, 2024 via email

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

Successfully merging this pull request may close these issues.

2 participants