summary refs log tree commit diff stats
path: root/compiler
diff options
context:
space:
mode:
Diffstat (limited to 'compiler')
-rw-r--r--compiler/cgmeth.nim3
-rw-r--r--compiler/types.nim2
2 files changed, 3 insertions, 2 deletions
diff --git a/compiler/cgmeth.nim b/compiler/cgmeth.nim
index 8ad6bf3f4..5821988bb 100644
--- a/compiler/cgmeth.nim
+++ b/compiler/cgmeth.nim
@@ -101,7 +101,8 @@ proc sameMethodBucket(a, b: PSym; multiMethods: bool): MethodResult =
       return No
   if result == Yes:
     # check for return type:
-    if not sameTypeOrNil(a.typ[0], b.typ[0]):
+    # ignore flags of return types; # bug #22673
+    if not sameTypeOrNil(a.typ[0], b.typ[0], {IgnoreFlags}):
       if b.typ[0] != nil and b.typ[0].kind == tyUntyped:
         # infer 'auto' from the base to make it consistent:
         b.typ[0] = a.typ[0]
diff --git a/compiler/types.nim b/compiler/types.nim
index 46433a230..4bc78cbb8 100644
--- a/compiler/types.nim
+++ b/compiler/types.nim
@@ -972,7 +972,7 @@ type
     ExactGcSafety
     AllowCommonBase
     PickyCAliases  # be picky about the distinction between 'cint' and 'int32'
-    IgnoreFlags          # used for borrowed functions; ignores the tfVarIsPtr flag
+    IgnoreFlags    # used for borrowed functions and methods; ignores the tfVarIsPtr flag
 
   TTypeCmpFlags* = set[TTypeCmpFlag]