Skip to content

Commit 1aeea19

Browse files
authored
add PARTITION_KIND_BACKDATED_CONST to UndefVarError_hint (#58260)
Wording updated based upon timholy's suggestion in #57969.
1 parent 95ac8c2 commit 1aeea19

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

base/errorshow.jl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1169,6 +1169,8 @@ function UndefVarError_hint(io::IO, ex::UndefVarError)
11691169
print(io, "\nSuggestion: check for spelling errors or missing imports.")
11701170
elseif Base.is_some_explicit_imported(kind)
11711171
print(io, "\nSuggestion: this global was defined as `$(Base.partition_restriction(bpart).globalref)` but not assigned a value.")
1172+
elseif kind === Base.PARTITION_KIND_BACKDATED_CONST
1173+
print(io, "\nSuggestion: define the const at top-level before running function that uses it (stricter Julia v1.12+ rule).")
11721174
end
11731175
elseif scope === :static_parameter
11741176
print(io, "\nSuggestion: run Test.detect_unbound_args to detect method arguments that do not fully constrain a type parameter.")

0 commit comments

Comments
 (0)