Aladdin - Scala Bugtracking
[#392] project: specification priority: low category: bug
submitter assigned to status date submitted
Philippe Martin fixed 2005-01-06 17:21:31.0
subject Problem with Template and TemplateBody
code
what happened
The current syntax defines Template and TemplateBody like this:

Template        ::=  Constr {`with' Constr} [TemplateBody]
TemplateBody    ::=  `{' [TemplateStat {`;' TemplateStat}] `}'
what expected It should probably be like that:
Template        ::=  Constr [TemplateBody]
TemplateBody    ::=  {`with' Constr} `{' [TemplateStat {`;' TemplateStat}] `}'
Otherwise the code below should be rejected.
trait T;
class C with T;
object O with T;
The syntax of classes and objects is defined like this:
TmplDef         ::=  ([case] class | trait) ClassDef
                  |  [case] object ObjectDef
ClassDef        ::=  ClassSig {`,' ClassSig} [`:' SimpleType] ClassTemplate
ClassSig        ::=  id [TypeParamClause] [ClassParamClause]
ObjectDef       ::=  id {`,' id} [`:' SimpleType] ClassTemplate

ClassTemplate   ::=  extends Template
                  |  TemplateBody
                  |
[back to overview]
Changes of this bug report
Martin  edited on  2006-10-30 16:38:33.0
this has been resolved in Scala 2.0