Skip to content

Commit

Permalink
for more compatibility, skip distinct types for non generic define
Browse files Browse the repository at this point in the history
  • Loading branch information
metagn committed Dec 16, 2024
1 parent 83a0a71 commit 4b4c86d
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion compiler/semstmts.nim
Original file line number Diff line number Diff line change
Expand Up @@ -622,7 +622,11 @@ proc checkDefineType(c: PContext; v: PSym; t: PType) =
of mBoolDefine: {tyBool}
of mGenericDefine: {tyString, tyCstring, tyInt..tyInt64, tyUInt..tyUInt64, tyBool, tyEnum}
else: raiseAssert("unreachable")
if t.skipTypes(abstractVarRange-{tyDistinct}).kind notin typeKinds:
var skipped = abstractVarRange
if v.magic == mGenericDefine:
# no distinct types for generic define
skipped.excl tyDistinct
if t.skipTypes(skipped).kind notin typeKinds:
let name =
case v.magic
of mStrDefine: "strdefine"
Expand Down

0 comments on commit 4b4c86d

Please sign in to comment.