Boo

WARNING: Visible method|property does not declare return|argument type explicitely

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
  • Number of attachments :
    0

Description

This is a strict mode warning (or to enable individually).
To avoid unnoticed/unwanted binary-breakage, and facilitate API documentability, this warns when a visible method (public|protected) has its return type, or one of its argument type, not explicitely declared.

Testcase:

"""
BCW0024-1.boo(16,5): BCW0024: WARNING: Visible property does not declare return type explicitely.
BCW0024-1.boo(28,5): BCW0024: WARNING: Visible property does not declare return type explicitely.
BCW0024-1.boo(38,19): BCW0024: WARNING: Visible method does not declare return type explicitely.
BCW0024-1.boo(44,9): BCW0024: WARNING: Visible method does not declare 's' argument type explicitely.
"""
macro enableBCW0024disableBCW0014:
	Context.Parameters.EnableWarning("BCW0024")
	Context.Parameters.DisableWarning("BCW0014") #unused privates
enableBCW0024disableBCW0014

interface IFoo:
	Good as int:
		get

	Bad: #!
		get

class Foo:
	Good as bool:
		get:
			return true

	private NotSoGood:
		get:
			return true

	Bad: #!
		get:
			return true

	protected def GoodMeth() as bool:
		return true

	internal def NotSoGoodMeth():
		return false

	protected def BadMeth(): #!
		return false

	def GoodMethArg(s as string) as bool:
		pass

	def BadMethArg(s) as bool: #!
		pass

	def GoodVoid() as void:
		pass

Issue Links

Activity

Hide
Cedric Vivier added a comment -

Landed in rev. 3182

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

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: