Wiki

Ticket #122 (closed enhancement: fixed)

Opened 9 years ago

Last modified 9 years ago

Support constants

Reported by: Chuck Owned by: Chuck
Priority: major Milestone: Cobra 0.9
Component: Cobra Compiler Version: 0.8.0
Keywords: constants Cc:

Description

Support constant declarations like those found in C#.

ticket:100 is somewhat related in that it covers "readonly" declarations. However, note that readonly fields cannot be used when constructing attributes. C# reports "error: An attribute argument must be a constant expression, typeof expression or array creation expression"

Which makes implementing constants more urgent.

See also  http://www.google.com/search?hl=en&q=C%23+constants

Attachments

const.patch Download (7.8 KB) - added by hopscc 9 years ago.

Change History

Changed 9 years ago by hopscc

  • owner set to hopscc
  • status changed from new to assigned

Do after patch for ticket:100.
Support as new keyword 'const' vs existing 'var'

Changed 9 years ago by hopscc

Changed 9 years ago by hopscc

  • owner changed from hopscc to Chuck

patch support const (keyword) on class data members (instead of 'var')
tests and relnote

Does not provide support for constant local variables.

Changed 9 years ago by Chuck

  • status changed from assigned to closed
  • resolution set to fixed

Thanks. Applied in changeset:1936

I refactored BoxVar? into BoxVar? and BoxConst? in changeset:1937

Also, you forgot to update ScanClrType?.cobra. Now done in changeset:1938

Note: See TracTickets for help on using tickets.