Boo

WARNING: Variable 'X' has the same name as a field of base type 'T'. Did you mean to use the field ?

Details

  • Type: New Feature New Feature
  • Status: Resolved Resolved
  • Priority: Minor Minor
  • Resolution: Fixed
  • Affects Version/s: 0.8.2
  • Fix Version/s: 0.9
  • Component/s: Compiler
  • Labels:
    None
  • Testcase included:
    yes
  • Number of attachments :
    0

Description

For implicitely declared variables/locals only.

Testcase:

"""
BCW0025-1.boo(33,9): BCW0025: WARNING: Variable 'i' has the same name as a private field of base type 'Base'. Did you mean to use the field?
BCW0025-1.boo(37,9): BCW0025: WARNING: Variable 'k' has the same name as a private field of base type 'BaseBase'. Did you mean to use the field?
"""
macro enableBCW0024disableBCW0014:
	Context.Parameters.EnableWarning("BCW0025")
	Context.Parameters.DisableWarning("BCW0014") #unused privates
enableBCW0024disableBCW0014

interface IFoo:
	def Foo()

interface IBar:
	def Bar()

class BaseBase:
	private k = 2
	internal o = "o"

class Base(BaseBase,IBar):
	private i = 0
	private j = 1
	n = 1

	virtual def Foo():
		print i

	virtual def Bar():
		pass

class E(Base,IFoo):
	def Foo():
		i = 42 #!
		print i

	def Bar():
		k = 0 #!
		print k

	def Baz():
		n = 84
		o = "O"

Issue Links

Activity

Hide
Cedric Vivier added a comment -

Landed in rev. 3183

Show
Cedric Vivier added a comment - Landed in rev. 3183

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: