KT-1388 Parse static final fields from java binary classes as non-null
#KT-1388 Fixed
This commit is contained in:
@@ -151,9 +151,9 @@ fun html(init : HTML.() -> Unit) : HTML {
|
||||
fun <K, V> Map<K, V>.set(key : K, value : V) = this.put(key, value)
|
||||
|
||||
fun println(message : Any?) {
|
||||
System.out?.println(message)
|
||||
System.out.println(message)
|
||||
}
|
||||
|
||||
fun print(message : Any?) {
|
||||
System.out?.print(message)
|
||||
System.out.print(message)
|
||||
}
|
||||
|
||||
@@ -26,6 +26,6 @@ val d = b.<!UNRESOLVED_REFERENCE!>x<!>
|
||||
|
||||
val s = <!NO_CLASS_OBJECT!>System<!> // error
|
||||
fun test() {
|
||||
System.out?.println()
|
||||
java.lang.System.out?.println()
|
||||
System.out.println()
|
||||
java.lang.System.out.println()
|
||||
}
|
||||
|
||||
@@ -8,8 +8,8 @@ fun test() {
|
||||
a?.plus(1)
|
||||
}
|
||||
|
||||
val out : java.io.PrintStream? = null//= System.out
|
||||
val ins = System.`in`
|
||||
val out : java.io.PrintStream? = null
|
||||
val ins : java.io.InputStream? = null
|
||||
|
||||
out?.println()
|
||||
ins?.read()
|
||||
|
||||
@@ -35,7 +35,7 @@ fun test(<!UNUSED_PARAMETER!>l<!> : java.util.List<Int>) {
|
||||
// ...
|
||||
}
|
||||
catch(e: Exception) {
|
||||
System.out?.println(e.getMessage())
|
||||
System.out.println(e.getMessage())
|
||||
}
|
||||
|
||||
PrintStream("sdf")
|
||||
|
||||
@@ -22,10 +22,10 @@ fun main(args : Array<String>) {
|
||||
test(al, m)
|
||||
}
|
||||
fun test(a : List<Int>, m : Map<String, Int>) {
|
||||
System.out?.println(
|
||||
System.out.println(
|
||||
a.get(0) + 1
|
||||
)
|
||||
HashMap<Int, Int>().get(0)
|
||||
if (m.get("") != null)
|
||||
System.out?.println(m.get("").sure().plus(1))
|
||||
System.out.println(m.get("").sure().plus(1))
|
||||
}
|
||||
|
||||
@@ -3,5 +3,5 @@
|
||||
|
||||
fun foo(maybe: Int?) {
|
||||
val i : Int = maybe ?: throw RuntimeException("No value")
|
||||
System.out?.println(i)
|
||||
System.out.println(i)
|
||||
}
|
||||
|
||||
@@ -15,7 +15,7 @@ fun foo(){
|
||||
}
|
||||
|
||||
bar()
|
||||
System.out?.println(local)
|
||||
System.out.println(local)
|
||||
}
|
||||
|
||||
fun <T> Iterable<T>.foreach(operation: (element: T) -> Unit) {
|
||||
|
||||
+1
-1
@@ -9,7 +9,7 @@ fun main(args : Array<String>) {
|
||||
2 -> i = 2 // i is surrounded by a black border
|
||||
else -> <!UNRESOLVED_REFERENCE!>j<!> = 2
|
||||
}
|
||||
System.out?.println(i)
|
||||
System.out.println(i)
|
||||
}
|
||||
|
||||
//KT-351 Distinguish statement and expression positions
|
||||
|
||||
@@ -57,7 +57,7 @@ import outer.*
|
||||
|
||||
fun main(args: Array<String>) {
|
||||
|
||||
System.out?.print(1)
|
||||
System.out.print(1)
|
||||
|
||||
val command = parse("")
|
||||
|
||||
|
||||
@@ -23,6 +23,6 @@ fun <T : Any> T?.iterator() = object {
|
||||
fun main(args : Array<String>) {
|
||||
val i : Int? = 1
|
||||
for (x in i) {
|
||||
System.out?.println(x)
|
||||
System.out.println(x)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@ fun f(s: String?) {
|
||||
if (s != null) {
|
||||
s.length //ok
|
||||
var <!UNUSED_VARIABLE!>i<!> = s.length //error: Only safe calls are allowed on a nullable receiver
|
||||
System.out?.println(s.length) //error
|
||||
System.out.println(s.length) //error
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -39,7 +39,7 @@ fun evaluate(expr: StringBuilder, numbers: ArrayList<Int>): Int {
|
||||
}
|
||||
|
||||
fun main(args: Array<String>) {
|
||||
System.out?.println("24 game")
|
||||
System.out.println("24 game")
|
||||
val numbers = ArrayList<Int>(4)
|
||||
val rnd = Random();
|
||||
val prompt = StringBuilder()
|
||||
@@ -49,18 +49,18 @@ fun main(args: Array<String>) {
|
||||
if (i > 0) prompt.append(" ");
|
||||
prompt.append(n)
|
||||
}
|
||||
System.out?.println("Your numbers: " + prompt)
|
||||
System.out?.println("Enter your expression:")
|
||||
System.out.println("Your numbers: " + prompt)
|
||||
System.out.println("Enter your expression:")
|
||||
val reader = BufferedReader(InputStreamReader(System.`in`))
|
||||
val expr = StringBuilder(reader.readLine())
|
||||
try {
|
||||
val result = evaluate(expr, numbers)
|
||||
if (result != 24)
|
||||
System.out?.println("Sorry, that's " + result)
|
||||
System.out.println("Sorry, that's " + result)
|
||||
else
|
||||
System.out?.println("You won!");
|
||||
System.out.println("You won!");
|
||||
}
|
||||
catch(e: Throwable) {
|
||||
System.out?.println(e.getMessage())
|
||||
System.out.println(e.getMessage())
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,7 +11,7 @@ val items: ArrayList<Item> = ArrayList<Item>
|
||||
fun test(room : Object) {
|
||||
for(val item: Item? in items) {
|
||||
if (item?.room === room) {
|
||||
System.out?.println("You see " + item?.name)
|
||||
System.out.println("You see " + item?.name)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@ fun main(args : Array<String>)
|
||||
{
|
||||
val c = ArrayList<Int>()
|
||||
c.add(3)
|
||||
System.out?.println(++(c[0]))
|
||||
System.out?.println((c[1])--)
|
||||
System.out?.println(-(c[2]))
|
||||
System.out.println(++(c[0]))
|
||||
System.out.println((c[1])--)
|
||||
System.out.println(-(c[2]))
|
||||
}
|
||||
@@ -25,8 +25,8 @@ fun <T> generic_invoker(gen : () -> T) : T {
|
||||
return gen()
|
||||
}
|
||||
|
||||
fun println(message : Int) { System.out?.println(message) }
|
||||
fun println(message : Long) { System.out?.println(message) }
|
||||
fun println(message : Int) { System.out.println(message) }
|
||||
fun println(message : Long) { System.out.println(message) }
|
||||
inline fun run<T>(body : () -> T) : T = body()
|
||||
|
||||
fun main(args : Array<String>) {
|
||||
|
||||
@@ -8,7 +8,7 @@ fun bar(list : List<Int>) {
|
||||
for (i in 1..10) {
|
||||
list += i // error
|
||||
}
|
||||
System.out?.println(list)
|
||||
System.out.println(list)
|
||||
}
|
||||
|
||||
fun <T> List<T>.plusAssign(t : T) {
|
||||
|
||||
@@ -12,6 +12,6 @@ package demo
|
||||
|
||||
fun main(args : Array<String>) {
|
||||
for (a in filter(args, {it.length > 1})) {
|
||||
System.out?.println("Hello, ${a}!")
|
||||
System.out.println("Hello, ${a}!")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,5 +12,5 @@ fun <T> TypeInfo<T>.getJavaClass() : java.lang.Class<T> {
|
||||
fun getJavaClass<T>() = typeinfo<T>.getJavaClass()
|
||||
|
||||
fun main(args : Array<String>) {
|
||||
System.out?.println(getJavaClass<String>)
|
||||
System.out.println(getJavaClass<String>)
|
||||
}
|
||||
|
||||
@@ -4,5 +4,5 @@ fun main(args : Array<String>) {
|
||||
var s : Int? = Integer.valueOf(100)
|
||||
|
||||
val o = i .sure() + s.sure()
|
||||
System.out?.println(o)
|
||||
System.out.println(o)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user