Ticket #60 (closed defect: fixed)

Opened 13 years ago

Last modified 12 years ago

Method overrides can narrow a type from nilable to not-nilable

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


...but they should not be able to. This must be an error:

	def equals(other as Object) as bool is override
# must be:
	def equals(other as Object?) as bool is override

Change History

Changed 12 years ago by Chuck

  • milestone set to Cobra 0.9

The test case for methods should be something other than .equals as that is about to become a cue. Here's a proper test case:

class A

	def foo(s as String?)

class B
	inherits A
	def foo(s as String) is override  # .error. cannot narrow

class P

	def main is shared

Changed 12 years ago by Chuck

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

Fixed in changeset:1832

Note: See TracTickets for help on using tickets.