Skip to content

Commit

Permalink
fix #32325, struct plus outer ctor inside let (#32326)
Browse files Browse the repository at this point in the history
(cherry picked from commit 6451bdd)
  • Loading branch information
JeffBezanson authored and KristofferC committed Jul 1, 2019
1 parent 4a16023 commit 89f73ab
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/julia-syntax.scm
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
7 changes: 7 additions & 0 deletions test/syntax.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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()

0 comments on commit 89f73ab

Please sign in to comment.