SciNim / Unchained

A fully type safe, compile time only units library.
https://scinim.github.io/Unchained
109 stars 0 forks source link

skip postfix node when resolving distinct type from impl AST #45

Closed metagn closed 9 months ago

metagn commented 9 months ago

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.

Vindaar commented 9 months ago

Sorry for the delay! Should be less busy and more attentive again. I had no idea either that was a bug. Cool and thanks for the fix!