summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorAndreas Rumpf <rumpf_a@web.de>2016-07-19 15:24:42 +0200
committerAndreas Rumpf <rumpf_a@web.de>2016-07-19 15:24:42 +0200
commit2d8572e9489cff5a047b87d5a30a6886d96b93ad (patch)
treeb9b0a8eb2754a2f1a7e1cdc1381bc206b637b309
parent9eb909baf985b8f6d2b8bc55fee8e67744e9b6fe (diff)
downloadNim-2d8572e9489cff5a047b87d5a30a6886d96b93ad.tar.gz
fixes #4428
-rw-r--r--compiler/cgmeth.nim10
-rw-r--r--compiler/docgen.nim2
2 files changed, 9 insertions, 3 deletions
diff --git a/compiler/cgmeth.nim b/compiler/cgmeth.nim
index 312afec1a..3dbd4f815 100644
--- a/compiler/cgmeth.nim
+++ b/compiler/cgmeth.nim
@@ -69,13 +69,19 @@ proc sameMethodBucket(a, b: PSym): MethodResult =
       else:
         break
     if sameType(aa, bb):
-      if aa.kind == tyObject and result != Invalid: result = Yes
+      if aa.kind == tyObject and result != Invalid:
+        result = Yes
     elif aa.kind == tyObject and bb.kind == tyObject:
       let diff = inheritanceDiff(bb, aa)
       if diff < 0:
-        if result != Invalid: result = Yes
+        if result != Invalid:
+          result = Yes
+        else:
+          return No
       elif diff != high(int):
         result = Invalid
+      else:
+        return No
     else:
       return No
 
diff --git a/compiler/docgen.nim b/compiler/docgen.nim
index cf03718ca..1ce21285e 100644
--- a/compiler/docgen.nim
+++ b/compiler/docgen.nim
@@ -355,7 +355,7 @@ proc docstringSummary(rstText: string): string =
   ## Also, we hope to not break the rst, but maybe we do. If there is any
   ## trimming done, an ellipsis unicode char is added.
   const maxDocstringChars = 100
-  assert (rstText.len < 2 or (rstText[0] == '#' and rstText[1] == '#'))
+  assert(rstText.len < 2 or (rstText[0] == '#' and rstText[1] == '#'))
   result = rstText.substr(2).strip
   var pos = result.find('\L')
   if pos > 0: