diff options
author | Martin Odersky <odersky@gmail.com> | 2016-09-12 13:01:28 +0200 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2016-10-02 16:12:28 +0200 |
commit | 845b689a4a652fa79a7d0621f5ebe15bbf9225c7 (patch) | |
tree | ce308233797b8b032b25c8ed29b6663da8742340 /docs | |
parent | b559aff35d6d365284fc1e05a3ca49a17551df29 (diff) | |
download | dotty-845b689a4a652fa79a7d0621f5ebe15bbf9225c7.tar.gz dotty-845b689a4a652fa79a7d0621f5ebe15bbf9225c7.tar.bz2 dotty-845b689a4a652fa79a7d0621f5ebe15bbf9225c7.zip |
Add inline for vals
- allow inline as an alternative to final for vals
(final is retained for backwards compatibility for now)
- allow inline for parameters
- check that rhs of inline value has a constant type
- check that arguments to inline value parameters have constant type
- check that inline members are not deferred
- make inline members effectively final
Diffstat (limited to 'docs')
-rw-r--r-- | docs/SyntaxSummary.txt | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/docs/SyntaxSummary.txt b/docs/SyntaxSummary.txt index 6c83c71ab..519180775 100644 --- a/docs/SyntaxSummary.txt +++ b/docs/SyntaxSummary.txt @@ -231,14 +231,15 @@ grammar. ClsParamClauses ::= {ClsParamClause} [[nl] `(' `implicit' ClsParams `)'] ClsParamClause ::= [nl] `(' [ClsParams] ')' ClsParams ::= ClsParam {`' ClsParam} - ClsParam ::= {Annotation} [{Modifier} (`val' | `var')] Param ValDef(mods, id, tpe, expr) -- point of mods on val/var + ClsParam ::= {Annotation} + [{Modifier} (`val' | `var') | `inline'] Param ValDef(mods, id, tpe, expr) -- point of mods on val/var Param ::= id `:' ParamType [`=' Expr] | INT DefParamClauses ::= {DefParamClause} [[nl] `(' `implicit' DefParams `)'] DefParamClause ::= [nl] `(' [DefParams] ')' DefParams ::= DefParam {`,' DefParam} - DefParam ::= {Annotation} Param ValDef(mods, id, tpe, expr) -- point of mods at id. + DefParam ::= {Annotation} [`inline'] Param ValDef(mods, id, tpe, expr) -- point of mods at id. Bindings ::= `(' Binding {`,' Binding `)' bindings Binding ::= (id | `_') [`:' Type] ValDef(_, id, tpe, EmptyTree) |