Skip to content

Commit

Permalink
Fix #1032: quoted arguments: scan sibling arguments and this
Browse files Browse the repository at this point in the history
  • Loading branch information
Tarmil committed Oct 24, 2018
1 parent 38fea1f commit c1ea94e
Showing 1 changed file with 12 additions and 9 deletions.
21 changes: 12 additions & 9 deletions src/compiler/WebSharper.Compiler.FSharp/CodeReader.fs
Original file line number Diff line number Diff line change
Expand Up @@ -1184,16 +1184,19 @@ let scanExpression (env: Environment) (containingMethodName: string) (expr: FSha
| Member.Method(_, m) ->
match env.Compilation.TryLookupQuotedArgMethod(typ, m) with
| Some x ->
Option.iter scan this
x |> Array.iter (fun i ->
let arg = arguments.[i]
match arg with
| P.Quote e -> Some e
| P.Value v ->
match vars.TryGetValue v with
| true, e -> Some e
| false, _ -> None
| _ -> None
|> Option.iter (fun e ->
let e =
match arg with
| P.Quote e -> Some e
| P.Value v ->
match vars.TryGetValue v with
| true, e -> Some e
| false, _ -> None
| _ -> None
match e with
| Some e ->
let pos = e.Range.AsSourcePos
let e = transformExpression env e
let argTypes = [ for (v, _, _) in env.FreeVars -> env.SymbolReader.ReadType Map.empty v.FullType ]
Expand All @@ -1218,7 +1221,7 @@ let scanExpression (env: Environment) (containingMethodName: string) (expr: FSha
| _ -> false
if not isTrivial then
quotations.Add(pos, qm, argNames, f)
)
| None -> scan arg
)
| _ -> default'()
| _ -> default'()
Expand Down

0 comments on commit c1ea94e

Please sign in to comment.