Ticket #344 (closed defect: fixed)
Compiler chokes on newline between property doctstring and body
Reported by: | Jonno | Owned by: | |
---|---|---|---|
Priority: | minor | Milestone: | |
Component: | Cobra Compiler | Version: | 0.9.4 |
Keywords: | Cc: |
Description
Apologies if this is known / by design - this is my first day with Cobra.
Working through the howto, I producted the following code:
class Person var _name as String cue init(name as String) base.init _name = name pro name as String """ Name of the Person. """ get return _name set _name = value.trim def printName print .name def sayHello print 'Hi, my name is [.name]' class Program def main p = Person('chuck') print p.name assert p.name == 'chuck' p.name = 'Chuck'
which caused the compiler to produce:
error: Expecting "get" or "set" for the property.
which is seemingly due to the newline following the docblock in the name property.
Removing the newline allows the code to compile, but this feels strange as the limitation does not seem to be in place for classes or methods.
Change History
Note: See
TracTickets for help on using
tickets.