Extension functions + functions type with receivers
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
/*
|
||||
class Example(a : Foo, i : Int) : Bar(i), Some {
|
||||
// constrtuctors:
|
||||
public this(a : Foo) : this(a, 0)
|
||||
@@ -25,7 +26,7 @@ class Example(a : Foo, i : Int) : Bar(i), Some {
|
||||
private set(s : String) { $z = s } // TODO: allow to omit the type here?
|
||||
}
|
||||
}
|
||||
|
||||
*/
|
||||
|
||||
// h5. Grammar
|
||||
|
||||
|
||||
@@ -9,9 +9,9 @@ completeExtension
|
||||
;
|
||||
|
||||
extensionMethod
|
||||
: accessModifier? "extension" "fun" type "." functionRest
|
||||
: accessModifier? "fun" type "." functionRest
|
||||
;
|
||||
|
||||
extensionProperty
|
||||
: accessModifier? "extension" propertyRest
|
||||
: accessModifier? propertyModifier? ("val" | "var") type "." propertyRest
|
||||
;
|
||||
|
||||
@@ -25,7 +25,7 @@ projectionSpecifier
|
||||
;
|
||||
|
||||
functionType
|
||||
: "{" functionTypeContents "}"
|
||||
: (type ".")? "{" functionTypeContents "}"
|
||||
;
|
||||
|
||||
functionTypeContents
|
||||
|
||||
Reference in New Issue
Block a user