Issue Details (XML | Word | Printable)

Key: BOO-1132
Type: New Feature New Feature
Status: Resolved Resolved
Resolution: Fixed
Priority: Minor Minor
Assignee: Cedric Vivier
Reporter: Cedric Vivier
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Boo

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

Created: 23/Jan/09 10:39 AM   Updated: 23/Jan/09 10:54 AM   Resolved: 23/Jan/09 10:54 AM
Return to search
Component/s: Compiler
Affects Version/s: 0.8.2
Fix Version/s: 0.9

Time Tracking:
Not Specified

Issue Links:
dependent
 


 Description  « Hide

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


Cedric Vivier added a comment - 23/Jan/09 10:54 AM

Landed in rev. 3182