Details
Description
Sometimes Boo is not conservative enough on certain defaults (which still makes sense for other/prototyping usages) that can lead to some errors slipping to a release unnoticed in (large) projects.
Strict mode introduces more conservative(safer) defaults and warnings.
Strict mode is disabled by default.
This compiler option is settable through:
- "-strict" with booc
- programatically by setting CompilerParameters.Strict to true
- "strict" argument with nant and msbuild tasks
When strict mode is enabled the following changes are enabled:
- default visibility is private like in C# (change made through
BOO-1091) - methods parameters types and return type of public methods (API) must be explicitely declared [to avoid unnoticed/unwanted binary-compat breakage] (
BOO-1132) - warns if a variable has the same name as a private field of one of its super types (
BOO-1133). - implicit return statement fires a warning (
BOO-703)
TODO:
- implicit downcast fires a warning (
BOO-943) — default mode? or strict mode only?
Issue Links
- depends upon
-
BOO-1091
Possibility to change default visibility settings
-
-
BOO-1132
WARNING: Visible method|property does not declare return|argument type explicitely
-
-
BOO-1133
WARNING: Variable 'X' has the same name as a field of base type 'T'. Did you mean to use the field ?
-
-
BOO-703
Compiler warning on implicit return statement
-
- is related to
-
BOO-1087
Compiler should warn when an implicit callable is used in a boolean context
-
-
BOO-692
Built-in value type conversions
-
- supercedes
-
BOO-1092
Change default field visibility from protected to private
-
-
BOO-943
Implicit downcast in strict mode
-
BOO-703is also worth considering for strict mode imo.