Ticket #76 (new defect)

Opened 8 weeks ago

to? should give warnings if the operation is redundant

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

Description

The expression a to? B is a no-op when a is already of type B or B?. There are already warnings for a to B when that is redundant, so this is missing for to?.

Should get two warnings below; currently get none.

class A

	def main is shared
		a = A()
		b = a to? A  # .warning.
		c = a to ?
		d = c to? A  # .warning.
		CobraCore.noOp(a, b, c, d)
Note: See TracTickets for help on using tickets.