Skip to content

Commit 25b9296

Browse files
committed
adjust to the FieldError change
xref: JuliaLang/julia#58507
1 parent 002fbd1 commit 25b9296

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/analyzers/jetanalyzer.jl

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1198,11 +1198,17 @@ const DIVIDE_ERROR_MSG = sprint(showerror, DivideError())
11981198
@nospecs type_error_msg(f, expected, actual) =
11991199
lazy"TypeError: in $f, expected $expected, got a value of type $actual"
12001200
function field_error_msg(@nospecialize(typ), name::Symbol)
1201+
typ = typ::Union{UnionAll,DataType}
12011202
flds = join(map(n->"`$n`", fieldnames(typ)), ", ")
12021203
if typ <: Tuple
12031204
typ = Tuple # reproduce base error message
12041205
end
1205-
tname = nameof(typ::Union{DataType,UnionAll})
1206+
@static if VERSION v"1.12.0-beta4"
1207+
# JuliaLang/julia#58507
1208+
tname = string(typ.name.wrapper)
1209+
else
1210+
tname = string(typ.name)
1211+
end
12061212
return lazy"FieldError: type $tname has no field `$name`, available fields: $flds"
12071213
end
12081214
function bounds_error_msg(@nospecialize(typ), name::Int)
@@ -1260,7 +1266,7 @@ function report_fieldaccess!(analyzer::JETAnalyzer, sv::InferenceState, @nospeci
12601266
end
12611267

12621268
namev = (name::Const).val
1263-
objtyp = s00
1269+
objtyp = s
12641270
if namev isa Symbol
12651271
msg = field_error_msg(objtyp, namev)
12661272
elseif namev isa Int

0 commit comments

Comments
 (0)