summary refs log tree commit diff stats
path: root/compiler
diff options
context:
space:
mode:
authorZahary Karadjov <zahary@gmail.com>2017-04-18 23:55:59 +0300
committerZahary Karadjov <zahary@gmail.com>2017-04-18 23:55:59 +0300
commit3e52bb6535a70339cf4a15123be09916ef0c31f6 (patch)
tree7ca6696bc579014182dfe982f0b2c17f646177ad /compiler
parent13701c09579447d3c54f6a1e27ab24b89b11b9e9 (diff)
downloadNim-3e52bb6535a70339cf4a15123be09916ef0c31f6.tar.gz
fix a regrsesion in signature matching of derived ptr types
Diffstat (limited to 'compiler')
-rw-r--r--compiler/sigmatch.nim8
1 files changed, 5 insertions, 3 deletions
diff --git a/compiler/sigmatch.nim b/compiler/sigmatch.nim
index a8551fa19..d6a0c6382 100644
--- a/compiler/sigmatch.nim
+++ b/compiler/sigmatch.nim
@@ -1240,13 +1240,15 @@ proc typeRel(c: var TCandidate, f, aOrig: PType, doBind = true): TTypeRelation =
         if prev == nil: put(c, f, a)
         result = isGeneric
       else:
-        var aAsObject = roota.lastSon
-        if rootf.lastSon.kind in {tyAnd, tyOr}:
+        let fKind = rootf.lastSon.kind
+        if fKind in {tyAnd, tyOr}:
           result = typeRel(c, lastSon(f), a)
           if result != isNone: put(c, f, a)
           return
 
-        if rootf.lastSon.kind == tyRef and aAsObject.kind == tyRef:
+        var aAsObject = roota.lastSon
+
+        if fKind in {tyRef, tyPtr} and aAsObject.kind == fKind:
           aAsObject = aAsObject.base
 
         if aAsObject.kind == tyObject: