Ticket #252 (closed defect: duplicate)
var x = 1 as readonly syntax doesn't work.
Reported by: | nevdelap | Owned by: | |
---|---|---|---|
Priority: | major | Milestone: | |
Component: | Cobra Compiler | Version: | 0.8.0 |
Keywords: | Cc: |
Description
If it should work then the bug report is that it doesn't. If it shouldn't work then the bug report is that the errors it gives indicate something odd going on.
@args -pkg:gtk-sharp-2.0 use Gdk class Colors shared var black as Color is public, readonly var white = Color(255, 255, 255) is public, readonly cue init .black = Color(0, 0, 0) class P def main is shared print Colors.black, Colors.white
test2.cobra(10): error: Expecting an expression. "public" is a reserved keyword that is not expected here.
var white = Color(255, 255, 255) is readonly
test2.cobra(10): error: Cannot find "readonly".
var white = Color(255, 255, 255) is readonly, public
test2.cobra(10): error: Expecting EOL, but got "," (COMMA) instead.
var black as Color is readonly var black as Color is readonly, public
These are fine.
Change History
Note: See
TracTickets for help on using
tickets.