Ticket #197: lambda-return.patch
File lambda-return.patch, 1.8 KB (added by hopscc, 15 years ago) |
---|
-
Source/Statements.cobra
1083 1083 .throwError('Cannot return [expr.type.name] because "[curCodeMember.name]" is [suffix]') 1084 1084 expr.contextType = curCodeMember.resultType 1085 1085 else 1086 if curCodeMember.resultType is not .compiler.voidType 1086 if curCodeMember.resultType is not .compiler.voidType and curCodeMember.resultType is not .compiler.passThroughType 1087 1087 .throwError('Return statement must return a [curCodeMember.resultType.name], or [curCodeMember.name] must have its return type removed.') 1088 1088 curCodeMember.hasReturnStmt = true 1089 1089 _backEndResultVarName = curCodeMember.backEndResultVarName -
Tests/320-misc-two/830-lambdas/300-lambdas-return.cobra
1 """ 2 Ticket#197 spurious compile error on return in lambda/anon fn with no return 3 """ 4 sig Delg 5 6 class DoX 7 def main is shared 8 i = 0 9 anon as Delg = do 10 if i > 7 11 return 12 assert i <=7 #print i 13 14 for i in 0: 10 15 anon() -
Developer/IntermediateReleaseNotes.text
431 431 * Fixed: An uncaught exception can occur for some library calls. 432 432 433 433 * Fixed: Cannot instantiate generic params under some circumstances. 434 435 * Fixed: Spurious compiler error in void anon method with a return. Ticket#197