KT-297 Overload resolution ambiguity with required in trait

This commit is contained in:
Andrey Breslav
2011-09-12 20:11:08 +04:00
parent dcabbc6c81
commit bd60d8ef1f
3 changed files with 13 additions and 1 deletions
@@ -0,0 +1,4 @@
// KT-297 Overload resolution ambiguity with required in trait
trait ALE<T> : java.util.ArrayList<T> {
fun getOrValue(index: Int, value : T) : T = if(index >= 0 && index < size()) get(index) else value
}