Wiki

Ticket #365 (closed defect: fixed)

Opened 11 years ago

Last modified 11 years ago

Regression with "has" and initial value on fields from changeset 3104

Reported by: nerdzero Owned by:
Priority: major Milestone:
Component: Cobra Compiler Version: 0.9.6
Keywords: attributes Cc:

Description

Changeset 3104 has introduced a regression regarding attributes on fields that have an initializer. Test case below.

class SomeAttribute inherits Attribute
	pass

class Program

	# used to work and still works
	var someVar
		has SomeAttribute
	
	# regression: used to work before changeset 3104
	# expecting DEDENT, but got "has" instead
	var someOtherVar = "initialValue"
		has SomeAttribute
	
	# never worked and still doesn't
	# Expecting EOL but got "has" instead
	#var foo has SomeAttribute
	
	def main
		pass

"has" and "is" should probably work the same way. The workaround I imagine is to initialize these in an init cue which I have not tried yet. This affects the MD/XS add-in.

Change History

Changed 11 years ago by Charles

  • status changed from new to closed
  • resolution set to fixed
Note: See TracTickets for help on using tickets.