Ticket #76 (closed defect: fixed)
to? should give warnings if the operation is redundant
Reported by: | Chuck | Owned by: | chuck |
---|---|---|---|
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)
Attachments
Change History
Note: See
TracTickets for help on using
tickets.