|
Revision 1702, 439 bytes
(checked in by Chuck.Esterbrook, 4 years ago)
|
|
Added storage type specification for enums.
|
-
Property svn:eol-style set to
native
|
| Line | |
|---|
| 1 | enum Medium |
|---|
| 2 | of uint64 |
|---|
| 3 | air |
|---|
| 4 | land |
|---|
| 5 | water |
|---|
| 6 | |
|---|
| 7 | |
|---|
| 8 | class Aircraft |
|---|
| 9 | |
|---|
| 10 | def canTravelIn(medium as Medium) as bool |
|---|
| 11 | return medium == Medium.air # former bug caused compiler to barf |
|---|
| 12 | |
|---|
| 13 | def assignSystemEnumResultTypeToLocalVar |
|---|
| 14 | platform = Environment.osVersion.platform # former bug. CLR type was not scanned |
|---|
| 15 | CobraCore.noOp(platform) |
|---|
| 16 | |
|---|
| 17 | def main is shared |
|---|
| 18 | assert Aircraft().canTravelIn(Medium.air) |
|---|
| 19 | assert not Aircraft().canTravelIn(Medium.water) |
|---|