mirror of
https://github.com/nim-lang/Nim.git
synced 2026-07-29 11:47:56 +00:00
…er base method returning a lent fixes #22673
This commit is contained in:
@@ -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]
|
||||
|
||||
@@ -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]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user