diff options
author | Araq <rumpf_a@web.de> | 2015-07-02 16:29:22 +0200 |
---|---|---|
committer | Araq <rumpf_a@web.de> | 2015-07-02 16:29:22 +0200 |
commit | 560cfd48fc21205a7e7e0d4f17e2173e98fe76d3 (patch) | |
tree | d670a73c4c0586adf149a9469e446e18ebec182e | |
parent | 9b01f1bedb464e860f8c0f1ffa2df8c17bc26fb7 (diff) | |
download | Nim-560cfd48fc21205a7e7e0d4f17e2173e98fe76d3.tar.gz |
fixes broken merge
-rw-r--r-- | compiler/sigmatch.nim | 6 | ||||
-rw-r--r-- | tests/generics/moverloading_typedesc.nim | 4 | ||||
-rw-r--r-- | tests/generics/toverloading_typedesc.nim | 2 |
3 files changed, 8 insertions, 4 deletions
diff --git a/compiler/sigmatch.nim b/compiler/sigmatch.nim index 902b3bd61..fa27a8c95 100644 --- a/compiler/sigmatch.nim +++ b/compiler/sigmatch.nim @@ -158,11 +158,15 @@ proc sumGeneric(t: PType): int = t = t.sons[0] inc result inc isvar + of tyTypeDesc: + t = t.lastSon + if t.kind == tyEmpty: break + inc result of tyGenericInvocation, tyTuple: result += ord(t.kind == tyGenericInvocation) for i in 0 .. <t.len: result += t.sons[i].sumGeneric break - of tyGenericParam, tyExpr, tyStatic, tyStmt, tyTypeDesc: break + of tyGenericParam, tyExpr, tyStatic, tyStmt: break of tyBool, tyChar, tyEnum, tyObject, tyProc, tyPointer, tyString, tyCString, tyInt..tyInt64, tyFloat..tyFloat128, tyUInt..tyUInt64: diff --git a/tests/generics/moverloading_typedesc.nim b/tests/generics/moverloading_typedesc.nim index e0980bf4a..92805fb7b 100644 --- a/tests/generics/moverloading_typedesc.nim +++ b/tests/generics/moverloading_typedesc.nim @@ -5,7 +5,7 @@ type FBar* = object proc new*(_: typedesc[FFoo]): int = 2 -#proc new*[T](_: typedesc[T]): int = 3 -#proc new*(_: typedesc): int = 4 +proc new*[T](_: typedesc[T]): int = 3 +proc new*(_: typedesc): int = 4 proc new*(_: typedesc[seq[Table[int, seq[Table[int, string]]]]]): int = 5 proc new*(_: typedesc[seq[Table[int, seq[Table[int, typedesc]]]]]): int = 6 diff --git a/tests/generics/toverloading_typedesc.nim b/tests/generics/toverloading_typedesc.nim index 065f7c75d..5882640f2 100644 --- a/tests/generics/toverloading_typedesc.nim +++ b/tests/generics/toverloading_typedesc.nim @@ -10,7 +10,7 @@ type when isMainModule: - # doAssert FBar.new() == 3 + doAssert FBar.new() == 3 proc new(_: typedesc[LFoo]): int = 0 proc new[T](_: typedesc[T]): int = 1 |