Ticket #41 (accepted defect)
False warning for if statement on box var
Reported by: | Chuck | Owned by: | Chuck |
---|---|---|---|
Priority: | minor | Milestone: | |
Component: | Cobra Compiler | Version: | 0.8.0 |
Keywords: | Cc: |
Description
class X def main is shared x = X() x.compute var _foo as X? def compute if _foo .bar if _foo # false warning here since .bar can change _foo .bar def bar _foo = nil
The warning is: foo.cobra(12): warning: The expression "_foo" (of type "X") will always evaluate to true because it is not nilable. You can remove the expression.
This is low priority as it comes up rarely.
Attachments
Change History
Note: See
TracTickets for help on using
tickets.