From be29dd9155879b7279a0e69c399c70bc4f4a6d05 Mon Sep 17 00:00:00 2001 From: Andrey Breslav Date: Tue, 29 Nov 2011 22:14:16 +0300 Subject: [PATCH] Test for kt-524 --- .../quick/regressions/kt524.jet | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 compiler/testData/checkerWithErrorTypes/quick/regressions/kt524.jet diff --git a/compiler/testData/checkerWithErrorTypes/quick/regressions/kt524.jet b/compiler/testData/checkerWithErrorTypes/quick/regressions/kt524.jet new file mode 100644 index 00000000000..9ffcd1f564a --- /dev/null +++ b/compiler/testData/checkerWithErrorTypes/quick/regressions/kt524.jet @@ -0,0 +1,17 @@ +// KT-524 sure() returns T +// +JDK + +namespace StringBuilder + +import java.lang.StringBuilder + +//import std.io.* +//import java.io.* + +fun main(args : Array) { +} + +val Int.bd : StringBuilder get() = StringBuilder(this.toString()) +fun StringBuilder.plus(other : StringBuilder) : StringBuilder = this.append(other).sure1() // !!! + +fun T?.sure1() : T { return if (this != null) this else throw NullPointerException() }