Changeset 2420
- Timestamp:
- 08/24/10 03:12:39 (18 months ago)
- Location:
- cobra/trunk
- Files:
-
- 1 added
- 2 modified
-
Developer/IntermediateReleaseNotes.text (modified) (1 diff)
-
Source/BackEndClr/SharpGenerator.cobra (modified) (2 diffs)
-
Tests/140-structs/210-struct-init.cobra (added)
Legend:
- Unmodified
- Added
- Removed
-
cobra/trunk/Developer/IntermediateReleaseNotes.text
r2419 r2420 478 478 479 479 * Fixed: Some invariants cause an internal error. ticket:248 480 481 * Fixed: Bad code gen for structs containing ref types. ticket:238 -
cobra/trunk/Source/BackEndClr/SharpGenerator.cobra
r2409 r2420 1539 1539 sw.write(' = ') 1540 1540 _initExpr.writeSharpDef(sw) 1541 else if .type.isReference and not .type.nonNil inherits GenericParam1541 else if _canInitDefault 1542 1542 sharpInit = .type.sharpInit 1543 1543 if sharpInit.length … … 1545 1545 sw.write(sharpInit) 1546 1546 sw.write(';\n') 1547 1548 def _canInitDefault as bool 1549 # In C#, struct members can't be explicitly init'ed on declaration 1550 if .parentBox inherits Struct, return false 1551 return .type.isReference and not .type.nonNil inherits GenericParam 1547 1552 1548 1553



