Skip to content

Commit e68c0e7

Browse files
fix: add Julia 1.10 compatibility for Base.ispublic
Base.ispublic was introduced in Julia 1.11. This change wraps the call in a @static if VERSION check to maintain compatibility with Julia 1.10 and earlier supported versions. Fixes loading error on Julia 1.10: ERROR: UndefVarError: `ispublic` not defined 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent afa83fd commit e68c0e7

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/ModelingToolkit.jl

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,8 +112,11 @@ macro import_mtkbase()
112112
name in banned_names && continue
113113
startswith(string(name), '#') && continue
114114
push!(inner_using_expr.args, Expr(:., name))
115-
if Base.ispublic(MTKBase, name) && !Base.isexported(MTKBase, name)
116-
push!(inner_public_expr.args, name)
115+
# Base.ispublic was added in Julia 1.11
116+
@static if VERSION >= v"1.11"
117+
if Base.ispublic(MTKBase, name) && !Base.isexported(MTKBase, name)
118+
push!(inner_public_expr.args, name)
119+
end
117120
end
118121
end
119122

0 commit comments

Comments
 (0)