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
type test =
{
test_field: string[] option
}
let foo =
let bar = try (0).ToString() with e -> e.ToString()
let bar = [|bar|]
{ test_field = Some bar }
When passed through W# 4.6.0.361, results in:
WebSharper error FS9001 : Global error : System.Exception: Undefined variable during writing JavaScript: $3� at Microsoft.FSharp.Core.PrintfModule.PrintFormatToStringThenFail@1637.Invoke(String message) in E:\A\_work\130\s\src\fsharp\FSharp.Core\printf.fs:line 1637� at WebSharper.Compiler.JavaScriptWriter.transformId(Environment env, Id id)� at WebSharper.Compiler.JavaScriptWriter.transformExpr(Environment env, Expression expr)� at WebSharper.Compiler.JavaScriptWriter.transformStatement(Environment env, Statement statement)� at WebSharper.Compiler.JavaScriptWriter.add@286-6.Invoke(Statement a)� at Microsoft.FSharp.Primitives.Basics.List.iter[T](FSharpFunc`2 f, FSharpList`1 x) in E:\A\_work\130\s\src\fsharp\FSharp.Core\local.fs:line 91� at WebSharper.Compiler.JavaScriptWriter.flatten@283(Environment env, FSharpList`1 s)� at WebSharper.Compiler.JavaScriptWriter.transformStatement(Environment env, Statement statement)� at WebSharper.Compiler.JavaScriptWriter.transformStatement@409-15.Invoke(Unit unitVar0)� at WebSharper.Compiler.JavaScriptWriter.withFuncDecls@323(Environment env, FSharpFunc`2 f)� at WebSharper.Compiler.JavaScriptWriter.add@286-6.Invoke(Statement a)� at WebSharper.Compiler.JavaScriptWriter.add@286-6.Invoke(Statement a)� at Microsoft.FSharp.Primitives.Basics.List.iter[T](FSharpFunc`2 f, FSharpList`1 x) in E:\A\_work\130\s\src\fsharp\FSharp.Core\local.fs:line 91� at WebSharper.Compiler.JavaScriptWriter.flatten@283(Environment env, FSharpList`1 s)� at WebSharper.Compiler.JavaScriptWriter.transformStatement(Environment env, Statement statement)� at WebSharper.Compiler.JavaScriptWriter.transformExpr(Environment env, Expression expr)� at WebSharper.Compiler.JavaScriptWriter.transformExpr(Environment env, Expression expr)� at WebSharper.Compiler.JavaScriptWriter.transformStatement(Environment env, Statement statement)� at WebSharper.Compiler.JavaScriptWriter.add@286-6.Invoke(Statement a)� at Microsoft.FSharp.Primitives.Basics.List.iter[T](FSharpFunc`2 f, FSharpList`1 x) in E:\A\_work\130\s\src\fsharp\FSharp.Core\local.fs:line 91� at WebSharper.Compiler.JavaScriptWriter.flatten@283(Environment env, FSharpList`1 s)� at WebSharper.Compiler.JavaScriptWriter.transformStatement(Environment env, Statement statement)� at WebSharper.Compiler.JavaScriptWriter.transformExpr(Environment env, Expression expr)� at WebSharper.Compiler.JavaScriptWriter.transformExpr(Environment env, Expression expr)� at WebSharper.Compiler.Packager.exprToString(Preferences pref, FSharpFunc`2 getWriter, Expression statement)� at WebSharper.Compiler.FrontEnd.CreateResources(FSharpOption`1 comp, Info refMeta, Info current, Boolean sourceMap, FSharpOption`1 closures, AssemblyDefinition a)� at WebSharper.Compiler.FrontEnd.ModifyCecilAssembly(FSharpOption`1 comp, Info refMeta, Info current, Boolean sourceMap, FSharpOption`1 closures, AssemblyDefinition a)� at WebSharper.FSharp.Program.Compile$cont@219-3(WsConfig config, Loader loader, FSharpList`1 refs, Task`1 wsRefsMeta, Compilation comp, Info currentMeta, Unit unitVar)� at WebSharper.FSharp.Program.Compile$cont@202-2(WsConfig config, Boolean isBundleOnly, Loader loader, FSharpList`1 refs, Task`1 wsRefsMeta, Compilation comp, Unit unitVar)� at WebSharper.FSharp.Program.Compile$cont@64(WsConfig config, WarnSettings warnSettings, String thisName, Unit unitVar)� at WebSharper.FSharp.Program.compileMain$cont@310(String[] argv, Unit unitVar)� at WebSharper.FSharp.Program.main(String[] argv)
From testing, this seems to only happen with an option of array, and only if the value comes from a try/with construct.
The text was updated successfully, but these errors were encountered:
The following F# code:
When passed through W# 4.6.0.361, results in:
From testing, this seems to only happen with an option of array, and only if the value comes from a try/with construct.
The text was updated successfully, but these errors were encountered: