Ok here we go, takes 3 files to repro:
types.nim:
type Foo* = distinct int
lib.nim:
import types
proc Bar*[T](input:T) =
let x = 5.Foo
echo $x.int
echo input
bug.nim:
import lib
proc bug() =
Bar("HEllo World")
bug()
