You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
LanguagePrimitives error strings are initialized in default culture before usage in different culture #159
Some localized error strings in prim-types.fs are declared as module values, which causes them to be statically initialized long before they might be used. This means they might be initialized in a different culture than when they are actually used, which is not desirable.
Fix is to refactor these to be evaluated on-demand.
try
Seq.min []with e ->
printfn "%A" e //use default currentUICulture of process// change culture now
System.Threading.Thread.CurrentThread.CurrentUICulture <-new CultureInfo("it-IT")try
Seq.min []with e ->
printfn "%A" e // e message is wrong, because is not of 'it-IT' culture
@forki because i changed the function to be lazy loaded. But that was a breaking change for binary api ( these function are inlined inside the compiled assembly ), so assemblies compiled with old fsharp.core but using newer fsharp.core didnt find the functions => runtime crash.
I fixed this issue with #694 , but is should wait for next fsharp.core major version (5?). That's because code compiler with 4.1 will need >= 4.1, and that's not acceptable.
Also the pr has label committedbut it's not.
All explained there #694 (comment)
I'm closing this as Wont Fix. The problem is in practice very minor, and the original fix was rolled back because it would necessitate a breaking change
Activity
fix LanguagePrimitives.ErrorStrings messages depends on culture
latkin commentedon Aug 4, 2015
Re-opening this one as the fix was rolled back before 4.0
forki commentedon Jul 22, 2016
@latkin do you remember why this was rolled back?
latkin commentedon Jul 22, 2016
@forki
#486
#497
enricosada commentedon Jul 25, 2016
@forki because i changed the function to be lazy loaded. But that was a breaking change for binary api ( these function are inlined inside the compiled assembly ), so assemblies compiled with old fsharp.core but using newer fsharp.core didnt find the functions => runtime crash.
I fixed this issue with #694 , but is should wait for next fsharp.core major version (5?). That's because code compiler with
4.1will need>= 4.1, and that's not acceptable.Also the pr has label
committedbut it's not.All explained there #694 (comment)
So let's wait fsharp.core 5.0 😄
dsyme commentedon May 9, 2017
I'm closing this as Wont Fix. The problem is in practice very minor, and the original fix was rolled back because it would necessitate a breaking change