nullable safe calls supported (only for fields)
This commit is contained in:
@@ -0,0 +1,9 @@
|
||||
class Library {
|
||||
final static java.io.PrintStream ourOut;
|
||||
}
|
||||
|
||||
class User {
|
||||
void main() {
|
||||
Library.ourOut.print();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
namespace {
|
||||
open class Library {
|
||||
class object {
|
||||
val ourOut : PrintStream?
|
||||
}
|
||||
}
|
||||
open class User {
|
||||
fun main() : Unit {
|
||||
Library.ourOut?.print()
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
System.out.println("Hello, world");
|
||||
@@ -0,0 +1 @@
|
||||
System.`out`?.println("Hello, world")
|
||||
@@ -5,6 +5,6 @@ RED
|
||||
YELLOW
|
||||
BLUE
|
||||
override public fun run() : Unit {
|
||||
System.out.println(("name()=" + name() + ", toString()=" + toString()))
|
||||
System.`out`?.println(("name()=" + name() + ", toString()=" + toString()))
|
||||
}
|
||||
}
|
||||
@@ -21,7 +21,7 @@ break@test
|
||||
}
|
||||
}
|
||||
}
|
||||
System.out.println((if (foundIt)
|
||||
System.`out`?.println((if (foundIt)
|
||||
"Found it"
|
||||
else
|
||||
"Didn't find it"))
|
||||
@@ -1 +1 @@
|
||||
(o.toString() + "abc")
|
||||
(str.toString() + "abc")
|
||||
@@ -1 +1 @@
|
||||
((o.toString() + "abc"))
|
||||
((str.toString() + "abc"))
|
||||
Reference in New Issue
Block a user