@@ -1174,6 +1174,8 @@ end
11741174directsubtype (a:: DataType , b:: DataType ) = supertype (a). name === b. name
11751175directsubtype (a:: TypeConstructor , b:: DataType ) = directsubtype (a. body, b)
11761176directsubtype (a:: Union , b:: DataType ) = any (t-> directsubtype (t, b), a. types)
1177+ # Fallback to handle TypeVar's
1178+ directsubtype (a, b:: DataType ) = false
11771179function dumpsubtypes (io:: IO , x:: DataType , m:: Module , n:: Int , indent)
11781180 for s in names (m, true )
11791181 if isdefined (m, s) && ! isdeprecated (m, s)
@@ -1183,15 +1185,15 @@ function dumpsubtypes(io::IO, x::DataType, m::Module, n::Int, indent)
11831185 elseif isa (t, Module) && module_name (t) === s && module_parent (t) === m
11841186 # recurse into primary module bindings
11851187 dumpsubtypes (io, x, t, n, indent)
1186- elseif isa (t, TypeConstructor) && directsubtype (t, x)
1188+ elseif isa (t, TypeConstructor) && directsubtype (t:: TypeConstructor , x)
11871189 println (io)
11881190 print (io, indent, " " , m, " ." , s)
11891191 isempty (t. parameters) || print (io, " {" , join (t. parameters, " ," ), " }" )
11901192 print (io, " = " , t)
1191- elseif isa (t, Union) && directsubtype (t, x)
1193+ elseif isa (t, Union) && directsubtype (t:: Union , x)
11921194 println (io)
11931195 print (io, indent, " " , m, " ." , s, " = " , t)
1194- elseif isa (t, DataType) && directsubtype (t, x)
1196+ elseif isa (t, DataType) && directsubtype (t:: DataType , x)
11951197 println (io)
11961198 if t. name. module != = m || t. name. name != s
11971199 # aliases to types
0 commit comments