Closed cloudRoutine closed 7 years ago
This would allow pure modules to be made. I don't see how it helps since you can still use some type from referenced assembly which is equivalent to ref. BTW this can be implemented in linter (eg. VFPT).
FYI I suggested something similar to this in a comment to this other idea: /archive/suggestion-5670335-pure-functions-pure-keyword NOTE: you can still use mutable locals (as oppoosed to fields), in immutable code (because local vars in a method cannot be shared among threads).
I would prefer if this were implemented in FSharpLint. I will decline this for the core language and please add a suggestion there, if it isn't available already.
Add compiler-warning when using mutable or ref [10011624]
Submitted by Wael on 10/1/2015 12:00:00 AM
[ 7 votes ]
add compiler flag: --warn-mutable, --warn-ref which would generate warning when using mutable (either mutable keyword or when using ref). This would allow pure modules to be made. Note that F# doesn't have any "pure" tags on member methods like the "const" qualifier on C++ methods.
Response
\ by fslang-admin on 1/23/2016 12:00:00 AM **
See comment above. Declined since we’d prefer this to be implemented in tools such as FSharpLint. Don Syme, F# Language and Core Library Evolution