Optimize type checking for common cases
- Type equality for simple constructors (no arguments) - Subtyping on final classes
This commit is contained in:
+1
-1
@@ -3,7 +3,7 @@ package localObjects {
|
||||
~x~val x : Int
|
||||
}
|
||||
|
||||
class Foo {
|
||||
open class Foo {
|
||||
~foo()~fun foo() : Int
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
package toplevelObjectDeclarations
|
||||
|
||||
class Foo(y : Int) {
|
||||
open class Foo(y : Int) {
|
||||
~foo()~open fun foo() : Int = 1
|
||||
}
|
||||
|
||||
|
||||
@@ -40,7 +40,7 @@ fun f_plus(): Int {
|
||||
1 `contains`!in x
|
||||
}
|
||||
|
||||
~Foo~class Foo {
|
||||
open ~Foo~class Foo {
|
||||
~set1~fun set(i : Int, val1 : String) {}
|
||||
~get1~fun get(i : Int) : Int {}
|
||||
~get2~fun get(i : Int, j : Int) : String {}
|
||||
@@ -92,4 +92,4 @@ fun testUnitIncDec() {
|
||||
var x = UnitIncDec()
|
||||
x`uinc`++
|
||||
x`udec`--
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user