Closed lucaswerkmeister closed 9 years ago
Also includes ceylon/ceylon-spec#1126.
So what’s the supertype of ConstructorDefinition
? Per spec, a ConstructorDefinition
can only appear within a ClassBody
, not within an InterfaceBody
or Block
. However, without complement types ({Statement|Declaration~ConstructorDefinition*} content
), this would be a bit ugly to enforce within the type system… unless we say that ConstructorDefinition
doesn’t extend Declaration
.
But that’s probably too weird. Perhaps that’s a restriction we can either do via assertions, or just omit from ceylon.ast
altogether.
Regarding ExtendedType
: I think we’ll get rid of ClassInstantiation
and inline it into ClassSpecifier
(unchanged) and ExtendedType
(with the added possibility of a TypeNameWithTypeArguments
qualifier).
Actually… the compiler completely accepts:
class C {
shared new C() {}
shared new D() {}
}
class D() => C.D();
even though, per the spec, a ClassSpecifier
can only be qualified by super
:
ClassSpecifier: "=>" ("super" ".")? TypeNameWithArguments PositionalArguments
So perhaps that rule just wasn’t updated, and in fact ClassSpecifier
and ExtendedType
still have the same syntax, meaning we can keep ClassInstantiation
?
@gavinking?
@lucaswerkmeister fixed.
Thanks, then I’ll keep ClassInstantiation
.
Alright, I think we’re done here! I hope I haven’t forgotten anything…
We need to support constructors. See ceylon/ceylon-spec#796.
EDIT: Let’s make a task list.
ConstructorDefinition
(I think we’ll inline the spec’sConstructorHeader
)Update– obsolete, sinceClassBody
(see ceylon/ceylon-spec#1194)ConstructorDefinition
extendsDeclaration
– nope, that’s a subset ofConstructorExpression
MemberExpression
.– strictly speaking, not a subset ofConstructorMeta
TypeMeta
per-spec, but the RedHat compiler can’t parsememberQualifier.ConstructorName
at all, so we’ll omit it tooConstructorDec
, and don’t forget to update theDec.keyword
documentationExtendedType
(ceylon/ceylon-spec#1126) (I think we’ll inline the spec’sSuperclassOrConstructor
) – edit: actually, updateClassInstantiation
, which bothExtendedType
andClassSpecifier
wrapClassDefinition
(optional parameters)ceylon.ast.create