resolveTypeFromDistinct calls getImpl on the distinct type which yields an nkTypeDef node of the original distinct type declaration, and returns the first child of the node, what would normally be the type name.
Normally when a type is exported its name in the AST becomes an nkPostfix node, however due to a Nim bug this node was not saved in typed AST and the first child was always the type symbol node. If the bug in Nim is fixed, resolveTypeFromDistinct has to skip the postfix node here.
resolveTypeFromDistinct
callsgetImpl
on the distinct type which yields annkTypeDef
node of the original distinct type declaration, and returns the first child of the node, what would normally be the type name.Normally when a type is exported its name in the AST becomes an
nkPostfix
node, however due to a Nim bug this node was not saved in typed AST and the first child was always the type symbol node. If the bug in Nim is fixed,resolveTypeFromDistinct
has to skip the postfix node here.