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))
255255 if Base. isvarargtype (t)
256256 return Expr (:(... ), t. parameters[1 ])
257257 end
258- if t . hasfreetypevars
258+ if Base . has_free_typevars (t)
259259 params = map (t. parameters) do @nospecialize (p)
260260 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
262262 end
263263 return Expr (:curly , scopename (t. name), params... ):: Expr
264264 end
Original file line number Diff line number Diff line change 791791 end
792792 @test @interpret (f ()) === 3
793793end
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