File tree Expand file tree Collapse file tree 2 files changed +18
-2
lines changed Expand file tree Collapse file tree 2 files changed +18
-2
lines changed Original file line number Diff line number Diff line change @@ -574,15 +574,16 @@ macro generated(f)
574574 if isa (f, Expr) && (f. head === :function || is_short_function_def (f))
575575 body = f. args[2 ]
576576 lno = body. args[1 ]
577+ tmp = gensym (" tmp" )
577578 return Expr (:escape ,
578579 Expr (f. head, f. args[1 ],
579580 Expr (:block ,
580581 lno,
581582 Expr (:if , Expr (:generated ),
582583 # https://github.com/JuliaLang/julia/issues/25678
583584 Expr (:block ,
584- :(local tmp = $ body),
585- :(if tmp isa Core. CodeInfo; return tmp; else tmp; end )),
585+ :(local $ tmp = $ body),
586+ :(if $ tmp isa $ ( GlobalRef ( Core, : CodeInfo)) ; return $ tmp; else $ tmp; end )),
586587 Expr (:block ,
587588 Expr (:meta , :generated_only ),
588589 Expr (:return , nothing ))))))
Original file line number Diff line number Diff line change @@ -2981,6 +2981,21 @@ end
29812981@generated g25678 (x) = return :x
29822982@test g25678 (7 ) === 7
29832983
2984+ # issue 25678: module of name `Core`
2985+ # https://github.com/JuliaLang/julia/pull/40778/files#r784416018
2986+ @test @eval Module () begin
2987+ Core = 1
2988+ @generated f () = 1
2989+ f () == 1
2990+ end
2991+
2992+ # issue 25678: argument of name `tmp`
2993+ # https://github.com/JuliaLang/julia/pull/43823#discussion_r785365312
2994+ @test @eval Module () begin
2995+ @generated f (tmp) = tmp
2996+ f (1 ) === Int
2997+ end
2998+
29842999# issue #19012
29853000@test Meta. parse (" \U 2200" , raise= false ) == Symbol (" ∀" )
29863001@test Meta. parse (" \U 2203" , raise= false ) == Symbol (" ∃" )
You can’t perform that action at this time.
0 commit comments