Changeset 1733
- Timestamp:
- 11/05/08 12:12:45 (2 months ago)
- Location:
- cobra/trunk
- Files:
-
- 4 modified
-
Developer/IntermediateReleaseNotes.text (modified) (1 diff)
-
Source/Expr.cobra (modified) (1 diff)
-
Source/SharpGenerator.cobra (modified) (1 diff)
-
Tests/220-delegates-etc/100-delegates/110-declare-sig.cobra (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
cobra/trunk/Developer/IntermediateReleaseNotes.text
r1732 r1733 203 203 204 204 * Fixed: Cannot add a doc string for a `sig` declaration. 205 206 * Fixed: Nilable delegates cannot be called (`foo(arg1, arg2)`). -
cobra/trunk/Source/Expr.cobra
r1731 r1733 1497 1497 if _type is nil 1498 1498 assert expr.type is not nil 1499 if expr.type inherits MethodSig # TODO: probably still need to handle case of a method sig coming from a DLL 1500 _type = (expr.type to MethodSig).returnType 1499 exprType = expr.type 1500 if exprType inherits NilableType 1501 exprType = exprType.theWrappedType 1502 if exprType inherits MethodSig # TODO: probably still need to handle case of a method sig coming from a DLL 1503 _type = exprType.returnType 1501 1504 else if expr.receiverType and expr.receiverType.isSystemTypeClass 1502 1505 _type = .compiler.dynamicType 1503 else if expr .type inherits Box1506 else if exprType inherits Box 1504 1507 _type = expr.receiverType # for example, an IdentifierExpr of 'SomeClass' has a .receiverType of that class 1505 else if expr .type.isDynamic1508 else if exprType.isDynamic 1506 1509 _type = .compiler.nilableDynamicType 1507 1510 else -
cobra/trunk/Source/SharpGenerator.cobra
r1730 r1733 3348 3348 .writeSharpArgs(sw) 3349 3349 sw.write(')') 3350 else if expr.type inherits MethodSig 3350 else if expr.type inherits MethodSig or (expr.type inherits NilableType and (expr.type to NilableType).theWrappedType inherits MethodSig) 3351 3351 isMethodSig = true 3352 3352 else if expr.type.isSystemTypeClass or _type.isDynamic -
cobra/trunk/Tests/220-delegates-etc/100-delegates/110-declare-sig.cobra
r1732 r1733 31 31 32 32 def eval1 as int 33 # use the var with .invoke 33 34 if _op 34 35 return _op.invoke(_a, _b) … … 37 38 38 39 def eval2 as int 40 # use the var with direct call 39 41 if _op 40 42 return _op(_a, _b) 43 else 44 return 0 45 46 def eval3 as int 47 # use a property with invoke 48 # also testing nilable delegate 49 if .op 50 op = .op 51 return op.invoke(_a, _b) 52 else 53 return 0 54 55 def eval4 as int 56 # use a property with direct call 57 # also testing nilable delegate 58 if .op 59 op = .op 60 return op(_a, _b) 41 61 else 42 62 return 0
