baronfel / fsharp-lang-testbed

0 stars 0 forks source link

Add compiler-warning when using mutable or ref #4

Open baronfel opened 7 years ago

baronfel commented 7 years ago

Idea 10011624: Add compiler-warning when using mutable or ref

Status : declined

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.

baronfel commented 7 years ago

Comment by Radek Micek on 10/19/2015 2:57:00 PM

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).