(experimental) forbid setter call on init properties#11564
(experimental) forbid setter call on init properties#11564smoothdeveloper wants to merge 8 commits intodotnet:mainfrom
Conversation
…e still passes through not sure why I'm having None when TcGlobals is loading the attribute
|
The main check is in place, but I still need to fiddle about the way the Main blocker: in the current added test, the csharp compiler doesn't seem to be the right version for handling 'init' keyword: // TestFramework.fs line 288
let CSC = requirePackage ("Microsoft.Net.Compilers" ++ "2.7.0" ++ "tools" ++ "csc.exe")@KevinRansom / @brettfo is it something you would update for me in main branch or any other preferred route? Other questions to nail the code the best for later review:
pieces of information for my own reference:
|
|
@smoothdeveloper That's certainly an old C# compiler. I have no issue with updating to the latest stable of If we do update that version, it'll have to be changed both here and here (and possibly here). |
…ison of the `modreq` once in the codebase for now
|
I found one more location where the path to csc.exe needs to be updated: Line 500 in 3cf3076 |
|
Thanks @brettfo / @KevinRansom, I've updated the pointers to csc.exe and it works as I expect. I'll need to update FCS surface area (will do it on top of #11574 once merged). Remaining decision is whether we still support |
|
Any updates regarding this? It's still experimental, but what would we need to do to make it past that? |
|
Might be a bit of an ask, but if the breaking-ness of this change is what's holding it up, it would be nice to have it produce a warning in the meantime. Then I can be sure I'm not shooting myself in the foot. |
By current implementation, I'm assuming you mean the PR, right? Anything that'll help move this PR along 😁 Just a fairly unsophisticated, average user's opinion to add to the discussion: I do worry a little these days that F# is straying from C# a bit, especially with nullability and such. With C#'s feature set catching up, F#'s biggest pitch is its cleanliness, so although I can see some situations where |
|
Fixed in #13490 |
This is to explore addressing fsharp/fslang-suggestions#904
current plan:
810,tcPropertyCannotBeSet1,"Property '%s' cannot be set"message.AssignedItemSetter