No assertion error in getContainingPseudocode #KT-10983 Fixed

Also #EA-72954 Fixed
This commit is contained in:
Mikhail Glukhikh
2016-02-09 16:05:53 +03:00
parent f6fadc4fa5
commit eed4aa71db
3 changed files with 21 additions and 1 deletions
@@ -0,0 +1,15 @@
// "Create function" "false"
// ERROR: A 'return' expression required in a function with a block body ('{...}')
// ERROR: Cannot infer a type for this parameter. Please specify it explicitly.
// ERROR: Cannot infer a type for this parameter. Please specify it explicitly.
// ERROR: Expression 'return groupsByLength.values.firstOrNull { group -> {group.size == maximumSizeOfGroup} }' cannot be a selector (occur after a dot)
// ERROR: Unresolved reference: groupBy
// ERROR: Unresolved reference: it
// ERROR: Unresolved reference: maximumSizeOfGroup
fun doSomethingStrangeWithCollection(collection: Collection<String>): Collection<String>? {
val groupsByLength = collection.groupBy { s -> { s.length } }
val maximumSizeOfGroup = groupsByLength.values.maxBy { it.size }.
return groupsByLength.values.firstOrNull { group -> {group.size == maximumSizeOfGroup} }
}