Skip to content

Commit 21cbfd7

Browse files
krux02Araq
authored andcommitted
Refactor json macro (#12391)
* closes #12316 * make tjsonmacro work at js target * closes #12289 * closes #11988 * also fixed gdb related stuff
1 parent 5ba932e commit 21cbfd7

File tree

9 files changed

+393
-669
lines changed

9 files changed

+393
-669
lines changed

compiler/condsyms.nim

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,3 +98,4 @@ proc initDefines*(symbols: StringTableRef) =
9898
defineSymbol("nimHasStyleChecks")
9999
defineSymbol("nimToOpenArrayCString")
100100
defineSymbol("nimHasUsed")
101+
defineSymbol("nimFixedForwardGeneric")

compiler/types.nim

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1121,9 +1121,16 @@ proc sameTypeAux(x, y: PType, c: var TSameTypeClosure): bool =
11211121
result = sameChildrenAux(a, b, c) and sameFlags(a, b)
11221122
if result and {ExactGenericParams, ExactTypeDescValues} * c.flags != {}:
11231123
result = a.sym.position == b.sym.position
1124-
of tyGenericInvocation, tyGenericBody, tySequence,
1125-
tyOpenArray, tySet, tyRef, tyPtr, tyVar, tyLent, tySink, tyUncheckedArray,
1126-
tyArray, tyProc, tyVarargs, tyOrdinal, tyTypeClasses, tyOpt, tyOwned:
1124+
of tyBuiltInTypeClass:
1125+
assert a.len == 1
1126+
assert a[0].len == 0
1127+
assert b.len == 1
1128+
assert b[0].len == 0
1129+
result = a[0].kind == b[0].kind
1130+
of tyGenericInvocation, tyGenericBody, tySequence, tyOpenArray, tySet, tyRef,
1131+
tyPtr, tyVar, tyLent, tySink, tyUncheckedArray, tyArray, tyProc, tyVarargs,
1132+
tyOrdinal, tyCompositeTypeClass, tyUserTypeClass, tyUserTypeClassInst,
1133+
tyAnd, tyOr, tyNot, tyAnything, tyOpt, tyOwned:
11271134
cycleCheck()
11281135
if a.kind == tyUserTypeClass and a.n != nil: return a.n == b.n
11291136
result = sameChildrenAux(a, b, c)

0 commit comments

Comments
 (0)