From b467dc2de1659681aec91a9e7f6aac0d8a595945 Mon Sep 17 00:00:00 2001 From: Andrey Breslav Date: Thu, 27 Oct 2011 21:29:44 +0400 Subject: [PATCH] KT-127 Support extension functions in when expressions --- .../quick/regressions/kt127.jet | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 compiler/testData/checkerWithErrorTypes/quick/regressions/kt127.jet diff --git a/compiler/testData/checkerWithErrorTypes/quick/regressions/kt127.jet b/compiler/testData/checkerWithErrorTypes/quick/regressions/kt127.jet new file mode 100644 index 00000000000..7bcb076f08c --- /dev/null +++ b/compiler/testData/checkerWithErrorTypes/quick/regressions/kt127.jet @@ -0,0 +1,15 @@ +// KT-127 Support extension functions in when expressions + +class Foo() {} + +fun Any.equals(other : Any?) : Boolean = true +fun Any?.equals1(other : Any?) : Boolean = true + +fun main(args: Array) { + + val command : Foo? = null + when (command) { + .equals(null) => 1; // must be resolved + ?.equals(null) => 1 // same here + } +}