Skip to content

Commit 21bcb0b

Browse files
committed
fix settrans!! implementation
1 parent 7e89b6f commit 21bcb0b

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/simple_varinfo.jl

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -467,8 +467,14 @@ end
467467
function settrans!!(vi::ThreadSafeVarInfo{<:SimpleVarInfo}, trans)
468468
return Accessors.@set vi.varinfo = settrans!!(vi.varinfo, trans)
469469
end
470-
function settrans!!(::SimpleOrThreadSafeSimple, trans::Bool, vn::VarName)
471-
@info "Attempting to call `settrans!!` on a `SimpleVarInfo` for a specific variable `$vn`; this will be ignored"
470+
function settrans!!(vi::SimpleOrThreadSafeSimple, trans::Bool, ::VarName)
471+
# We keep this method around just to obey the AbstractVarInfo interface; however,
472+
# this is only a valid operation if it would be a no-op.
473+
if trans != istrans(vi)
474+
error(
475+
"Individual variables in SimpleVarInfo cannot have different `settrans` statuses.",
476+
)
477+
end
472478
end
473479

474480
istrans(vi::SimpleVarInfo) = !(vi.transformation isa NoTransformation)

0 commit comments

Comments
 (0)