blob: aeb5e0f98849cce452b490aba666f44575bd2cc8 [file] [log] [blame]
/**
## Types
See [Types](basic-types.html)
*/
/*
Foo<Bar<X>, T, Object> // user type
(A, Object) -> Foo // function type
() -> Foo // function with no arguments
*/
type
: typeModifiers typeReference
;
// If you change this, consider updating TYPE_REF_FIRST in KotlinParsing
typeReference
: "(" typeReference ")"
: functionType
: userType
: nullableType
: "dynamic"
;
nullableType
: typeReference "?"
;
userType
: simpleUserType{"."}
;
simpleUserType
: SimpleName ("<" (projection? type | "*"){","} ">")?
;
projection
: varianceAnnotation
;
functionType
: (type ".")? "(" parameter{","}? ")" "->" type
;