JET-140 Change function type syntax
and tests for JET-168 Improve the parser for function and tuple types as receiver types
This commit is contained in:
@@ -18,10 +18,10 @@ namespace boundsWithSubstitutors {
|
||||
open class A {}
|
||||
open class B<T : A>()
|
||||
|
||||
class C<T : B<<error>Int</error>>, X : {(B<<error>Char</error>>) : (B<<error>Any</error>>, B<A>)}>() : B<<error>Any</error>>() { // 2 errors
|
||||
class C<T : B<<error>Int</error>>, X : fun (B<<error>Char</error>>) : (B<<error>Any</error>>, B<A>)>() : B<<error>Any</error>>() { // 2 errors
|
||||
val a = B<<error>Char</error>>() // error
|
||||
|
||||
val x : {(B<<error>Char</error>>) : B<<error>Any</error>>}
|
||||
val x : fun (B<<error>Char</error>>) : B<<error>Any</error>>
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ namespace jet121 {
|
||||
return if (answer == 2) "OK" else "FAIL"
|
||||
}
|
||||
|
||||
fun apply(arg:String, f : {String.() : Int}) : Int {
|
||||
fun apply(arg:String, f : fun String.() : Int) : Int {
|
||||
return arg.f()
|
||||
}
|
||||
}
|
||||
@@ -1,8 +1,8 @@
|
||||
fun foo1() : {(Int) : Int}
|
||||
fun foo1() : fun (Int) : Int
|
||||
|
||||
fun foo() {
|
||||
val h : {(Int) : Int} = foo1();
|
||||
val h : fun (Int) : Int = foo1();
|
||||
h(1)
|
||||
val m : {(Int) : Int} = {(a : Int) => 1}//foo1()
|
||||
val m : fun (Int) : Int = {(a : Int) => 1}//foo1()
|
||||
m(1)
|
||||
}
|
||||
Reference in New Issue
Block a user