diff options
Diffstat (limited to 'compiler')
-rw-r--r-- | compiler/magicsys.nim | 6 | ||||
-rw-r--r-- | compiler/semmagic.nim | 2 |
2 files changed, 5 insertions, 3 deletions
diff --git a/compiler/magicsys.nim b/compiler/magicsys.nim index 73eacc2d6..bc3d7434b 100644 --- a/compiler/magicsys.nim +++ b/compiler/magicsys.nim @@ -68,7 +68,7 @@ proc getSysType*(g: ModuleGraph; info: TLineInfo; kind: TTypeKind): PType = of tyUInt64: result = sysTypeFromName("uint64") of tyFloat: result = sysTypeFromName("float") of tyFloat32: result = sysTypeFromName("float32") - of tyFloat64: return sysTypeFromName("float64") + of tyFloat64: result = sysTypeFromName("float64") of tyFloat128: result = sysTypeFromName("float128") of tyBool: result = sysTypeFromName("bool") of tyChar: result = sysTypeFromName("char") @@ -79,7 +79,9 @@ proc getSysType*(g: ModuleGraph; info: TLineInfo; kind: TTypeKind): PType = else: internalError(g.config, "request for typekind: " & $kind) g.sysTypes[kind] = result if result.kind != kind: - internalError(g.config, "wanted: " & $kind & " got: " & $result.kind) + if kind == tyFloat64 and result.kind == tyFloat: discard # because of aliasing + else: + internalError(g.config, "wanted: " & $kind & " got: " & $result.kind) if result == nil: internalError(g.config, "type not found: " & $kind) proc resetSysTypes*(g: ModuleGraph) = diff --git a/compiler/semmagic.nim b/compiler/semmagic.nim index 41a920371..30ff73d7f 100644 --- a/compiler/semmagic.nim +++ b/compiler/semmagic.nim @@ -134,7 +134,7 @@ proc evalTypeTrait(c: PContext; traitCall: PNode, operand: PType, context: PSym) newTypeWithSons(context, kind, sons).toNode(traitCall.info) if operand.kind == tyGenericParam or (traitCall.len > 2 and operand2.kind == tyGenericParam): - return traitCall ## tpo early to evaluate + return traitCall ## too early to evaluate let s = trait.sym.name.s case s |