Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tests: allow test/compiler/AbstarctInterpreter.jl to be loaded multiple times #46172

Merged
merged 1 commit into from
Jul 26, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
tests: allow test/compiler/AbstarctInterpreter.jl to be loaded mult…
…iple times

It seems better to make it able to load that file multiple times rather
than trying hard to not pollute the namespace.
  • Loading branch information
aviatesk committed Jul 25, 2022
commit 4a20f062db4a49f184f7924809a429ca513b0f1e
3 changes: 2 additions & 1 deletion test/compiler/AbstractInterpreter.jl
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
# This file is a part of Julia. License is MIT: https://julialang.org/license

using Test
const CC = Core.Compiler
import Core: MethodInstance, CodeInstance
import .CC: WorldRange, WorldView

# define new `AbstractInterpreter` that satisfies the minimum interface requirements
# while managing its cache independently
macro newinterp(name)
cachename = gensym(string(name, "Cache"))
cachename = Symbol(string(name, "Cache"))
name = esc(name)
quote
struct $cachename
Expand Down