From 6acfcd913ed016aeaf546e31d7ea2c0c5b7ff339 Mon Sep 17 00:00:00 2001 From: Mike J Innes Date: Wed, 21 Dec 2016 13:04:54 +0000 Subject: [PATCH] fix self escaping --- src/compiler/code.jl | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/compiler/code.jl b/src/compiler/code.jl index aa5e847c..68134364 100644 --- a/src/compiler/code.jl +++ b/src/compiler/code.jl @@ -50,10 +50,11 @@ function process_type(ex) pnames = namify.(params) args, body = process_func(funcs[1], pnames) @assert length(args) == 1 + self = esc(:self) quote $(build_type(T, params)) - $(esc(:(self::$T)))($(args...),) = interpret(reifyparams(graph(self)), $(args...)) - $(esc(:(Flux.update!(self::$T, η)))) = ($(map(p -> :(update!(self.$p, η)), pnames)...);) + $(esc(:(self::$T)))($(args...),) = interpret(reifyparams(graph($self)), $(args...)) + $(esc(:(Flux.update!(self::$T, η)))) = ($(map(p -> :(update!($self.$p, η)), pnames)...);) $(esc(:(Flux.graph(self::$T)))) = $(DataFlow.constructor(mapconst(esc, makegraph(body, args)))) nothing end