Ticket #41 (accepted defect)

Opened 10 years ago

Last modified 10 years ago

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:


class X

	def main is shared
		x = X()

	var _foo as X?
	def compute
		if _foo
			if _foo  # false warning here since .bar can change _foo
	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.


fixNoWarnings.patch Download (1.7 KB) - added by hopscc 10 years ago.

Change History

Changed 10 years ago by hopscc

Changed 10 years ago by hopscc

patch for failure of warning suppression on Boxes.cobra:853
 Spurious warning on compiler compile

Changed 10 years ago by Chuck

  • status changed from new to accepted
  • owner set to Chuck

The problem addressed by the patch has been fixed, although I took a different approach and more importantly, added a test case to lock this down. changeset:1620

Note that the patch does not address the issue described by this ticket. It should not be confused as a fix for this ticket.

Note: See TracTickets for help on using tickets.