File tree Expand file tree Collapse file tree 2 files changed +15
-2
lines changed Expand file tree Collapse file tree 2 files changed +15
-2
lines changed Original file line number Diff line number Diff line change @@ -255,10 +255,10 @@ function parametric_type_to_expr(@nospecialize(t::Type))
255
255
if Base. isvarargtype (t)
256
256
return Expr (:(... ), t. parameters[1 ])
257
257
end
258
- if t . hasfreetypevars
258
+ if Base . has_free_typevars (t)
259
259
params = map (t. parameters) do @nospecialize (p)
260
260
isa (p, TypeVar) ? p. name :
261
- isa (p, DataType) && p . hasfreetypevars ? parametric_type_to_expr (p) : p
261
+ isa (p, DataType) && Base . has_free_typevars (p) ? parametric_type_to_expr (p) : p
262
262
end
263
263
return Expr (:curly , scopename (t. name), params... ):: Expr
264
264
end
Original file line number Diff line number Diff line change 791
791
end
792
792
@test @interpret (f ()) === 3
793
793
end
794
+
795
+ @testset " https://github.com/JuliaLang/julia/pull/41018" begin
796
+ m = Module ()
797
+ @eval m begin
798
+ struct Foo
799
+ foo:: Int
800
+ bar
801
+ end
802
+ end
803
+ # this shouldn't throw "type DataType has no field hasfreetypevars"
804
+ # even after https://github.com/JuliaLang/julia/pull/41018
805
+ @test Int === @interpret Core. Compiler. getfield_tfunc (m. Foo, Core. Compiler. Const (:foo ))
806
+ end
You can’t perform that action at this time.
0 commit comments