Skip to content

Commit

Permalink
Merge pull request #61 from intellifactory/fix-60
Browse files Browse the repository at this point in the history
Fix #60: can use the same simple hole in multiple places
  • Loading branch information
Tarmil committed Nov 24, 2015
2 parents 8dec929 + dea3470 commit 25c3654
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion WebSharper.UI.Next.Templating/Main.fs
Original file line number Diff line number Diff line change
Expand Up @@ -191,11 +191,13 @@ type TemplateProvider(cfg: TypeProviderConfig) as this =
name, if wrap then XElement(xn"body", e) else e
)

let addTemplateMethod (t: XElement) (toTy: ProvidedTypeDefinition) =
let addTemplateMethod (t: XElement) (toTy: ProvidedTypeDefinition) =
let holes = Dictionary()

let getSimpleHole name : Expr<'T> =
match holes.TryGetValue(name) with
| true, Hole.Simple t when t = typeof<'T> ->
()
| true, _ ->
failwithf "Invalid multiple use of variable name in the same template: %s" name
| false, _ ->
Expand Down

0 comments on commit 25c3654

Please sign in to comment.