timotheecour / Nim

Nim is a compiled, garbage-collected systems programming language with a design that focuses on efficiency, expressiveness, and elegance (in that order of priority).
http://nim-lang.org/
Other
2 stars 0 forks source link

warning instead of error for effect violations (nosideeffect, gcsafe, raise mismatches) #790

Open timotheecour opened 3 years ago

timotheecour commented 3 years ago

effect violations (raises, gcsafe, side-effects etc) should give warnRaiseMismatch, warnGcsafeMismatch, warnSideEffectMismatch instead of error, rationale:

this would significantly reduce impact of breaking changes for correctness bugfixes, eg if we discover that in some situation, a raise OsError can happen (eg getcwd can raise in rare conditions and a call now needs getcwd which adds a raise[OsError]), it wouldn't cause a CT error but instead a warnining (which can be turned into a CT error depending on warnaserror); it basically makes code evolution easier, and smooths the upgrade process of a new version of compiler/library.

Viral errors = bad; viral warnings = bearable

links