Wiki

Ticket #197 (closed defect: fixed)

Opened 15 years ago

Last modified 15 years ago

Spurious compiler error in void anon method with a return

Reported by: hopscc Owned by: Chuck
Priority: medium Milestone:
Component: Cobra Compiler Version: 0.8.0
Keywords: Cc:

Description

This generates a spurious compiler error. It should not.

sig Delg

class DoX
	def main is shared
		i = 0
		anon as Delg = do
			if i > 7
				return  #error thrown here -line 8.
			print i 
		
		for i in 0: 10
			anon()

Error is

dox.cobra(8): error: Return statement must return a passthrough, or (anonymous method 14735) must have its return type removed.

Attachments

lambda-return.patch Download (1.8 KB) - added by hopscc 15 years ago.

Change History

Changed 15 years ago by hopscc

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

Changed 15 years ago by hopscc

Changed 15 years ago by hopscc

  • owner changed from hopscc to Chuck

Changed 15 years ago by hopscc

  • summary changed from spurious compiler error in void anon method with a return to Spurious compiler error in void anon method with a return

Patvh, Test, relnote

Changed 15 years ago by Chuck

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

Fixed in changeset:2300
Thanks.

Note: See TracTickets for help on using tickets.