diff options
author | Arne Döring <arne.doering@gmx.net> | 2019-10-17 09:55:41 +0200 |
---|---|---|
committer | Andreas Rumpf <rumpf_a@web.de> | 2019-10-17 09:55:41 +0200 |
commit | 21cbfd72ec9fce04fab98326376651806c8adf0b (patch) | |
tree | bbdfd560551627b11a292c2f5913fae7d1104c98 /compiler | |
parent | 5ba932e43c9c971555d8fdc9e25e2edcdcdd70b4 (diff) | |
download | Nim-21cbfd72ec9fce04fab98326376651806c8adf0b.tar.gz |
Refactor json macro (#12391)
* closes #12316 * make tjsonmacro work at js target * closes #12289 * closes #11988 * also fixed gdb related stuff
Diffstat (limited to 'compiler')
-rw-r--r-- | compiler/condsyms.nim | 1 | ||||
-rw-r--r-- | compiler/types.nim | 13 |
2 files changed, 11 insertions, 3 deletions
diff --git a/compiler/condsyms.nim b/compiler/condsyms.nim index dd4ad3b3a..7707c1c0d 100644 --- a/compiler/condsyms.nim +++ b/compiler/condsyms.nim @@ -98,3 +98,4 @@ proc initDefines*(symbols: StringTableRef) = defineSymbol("nimHasStyleChecks") defineSymbol("nimToOpenArrayCString") defineSymbol("nimHasUsed") + defineSymbol("nimFixedForwardGeneric") diff --git a/compiler/types.nim b/compiler/types.nim index dc5068d0e..022995fa3 100644 --- a/compiler/types.nim +++ b/compiler/types.nim @@ -1121,9 +1121,16 @@ proc sameTypeAux(x, y: PType, c: var TSameTypeClosure): bool = result = sameChildrenAux(a, b, c) and sameFlags(a, b) if result and {ExactGenericParams, ExactTypeDescValues} * c.flags != {}: result = a.sym.position == b.sym.position - of tyGenericInvocation, tyGenericBody, tySequence, - tyOpenArray, tySet, tyRef, tyPtr, tyVar, tyLent, tySink, tyUncheckedArray, - tyArray, tyProc, tyVarargs, tyOrdinal, tyTypeClasses, tyOpt, tyOwned: + of tyBuiltInTypeClass: + assert a.len == 1 + assert a[0].len == 0 + assert b.len == 1 + assert b[0].len == 0 + result = a[0].kind == b[0].kind + of tyGenericInvocation, tyGenericBody, tySequence, tyOpenArray, tySet, tyRef, + tyPtr, tyVar, tyLent, tySink, tyUncheckedArray, tyArray, tyProc, tyVarargs, + tyOrdinal, tyCompositeTypeClass, tyUserTypeClass, tyUserTypeClassInst, + tyAnd, tyOr, tyNot, tyAnything, tyOpt, tyOwned: cycleCheck() if a.kind == tyUserTypeClass and a.n != nil: return a.n == b.n result = sameChildrenAux(a, b, c) |