Skip to content

Commit 6451bdd

Browse files
authored
fix #32325, struct plus outer ctor inside let (#32326)
1 parent 86bf1b2 commit 6451bdd

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

src/julia-syntax.scm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -840,9 +840,9 @@
840840
(error (string "field name \"" (deparse v) "\" is not a symbol"))))
841841
field-names)
842842
`(block
843+
(global ,name) (const ,name)
843844
(scope-block
844845
(block
845-
(global ,name) (const ,name)
846846
,@(map (lambda (v) `(local ,v)) params)
847847
,@(map (lambda (n v) (make-assignment n (bounds-to-TypeVar v #t))) params bounds)
848848
(struct_type ,name (call (core svec) ,@params)

test/syntax.jl

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1854,3 +1854,10 @@ macro id28992(x) x end
18541854
# issue #31596
18551855
f31596(x; kw...) = x
18561856
@test f31596((a=1,), b = 1.0) === (a=1,)
1857+
1858+
# issue #32325
1859+
let
1860+
struct a32325 end
1861+
a32325(x) = a32325()
1862+
end
1863+
@test a32325(0) === a32325()

0 commit comments

Comments
 (0)