From f30356861b35d6ed797e5a8056b5bbb8b322b958 Mon Sep 17 00:00:00 2001 From: Jeff Bezanson Date: Fri, 14 Jun 2019 16:40:56 -0400 Subject: [PATCH] fix #32325, struct plus outer ctor inside `let` --- src/julia-syntax.scm | 2 +- test/syntax.jl | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/julia-syntax.scm b/src/julia-syntax.scm index 171e607977021..c7270734123be 100644 --- a/src/julia-syntax.scm +++ b/src/julia-syntax.scm @@ -840,9 +840,9 @@ (error (string "field name \"" (deparse v) "\" is not a symbol")))) field-names) `(block + (global ,name) (const ,name) (scope-block (block - (global ,name) (const ,name) ,@(map (lambda (v) `(local ,v)) params) ,@(map (lambda (n v) (make-assignment n (bounds-to-TypeVar v #t))) params bounds) (struct_type ,name (call (core svec) ,@params) diff --git a/test/syntax.jl b/test/syntax.jl index 03e2498d6fa58..4e751a5a66eff 100644 --- a/test/syntax.jl +++ b/test/syntax.jl @@ -1854,3 +1854,10 @@ macro id28992(x) x end # issue #31596 f31596(x; kw...) = x @test f31596((a=1,), b = 1.0) === (a=1,) + +# issue #32325 +let + struct a32325 end + a32325(x) = a32325() +end +@test a32325(0) === a32325()