KT-12045 J2K: creating Object() instance could be converted to Any()

#KT-12045 Fixed
This commit is contained in:
Valentin Kipyatkov
2016-04-28 19:55:36 +03:00
parent 76e067c43a
commit 92af610322
11 changed files with 85 additions and 48 deletions
+1 -1
View File
@@ -1,5 +1,5 @@
internal object Outer {
var o: Any? = Object()
var o: Any? = Any()
class Nested {
fun foo() {
@@ -103,7 +103,7 @@ internal class A {
true.toString()
1.11f.toString()
3.14.toString()
Object().toString()
Any().toString()
String.format(Locale.FRENCH, "Je ne mange pas %d jours", 6)
String.format("Operation completed with %s", "success")
@@ -0,0 +1,6 @@
class C {
void foo() {
Object o1 = new Object() {};
Object o2 = new Object();
}
}
@@ -0,0 +1,8 @@
internal class C {
fun foo() {
val o1 = object : Any() {
}
val o2 = Any()
}
}