mirror of
https://github.com/nim-lang/Nim.git
synced 2026-01-05 20:47:53 +00:00
@@ -1268,7 +1268,7 @@ proc typeRel(c: var TCandidate, f, aOrig: PType, doBind = true): TTypeRelation =
|
||||
# crossing path with metatypes/aliases, so we need to separate them
|
||||
# by checking sym.id
|
||||
let genericSubtype = isGenericSubType(c, x, f, depth, f)
|
||||
if not (genericSubtype and aobj.sym.id != fobj.sym.id):
|
||||
if not (genericSubtype and aobj.sym.id != fobj.sym.id) and aOrig.kind != tyGenericBody:
|
||||
depth = -1
|
||||
|
||||
if depth >= 0:
|
||||
|
||||
12
tests/generics/tobjecttyperel3.nim
Normal file
12
tests/generics/tobjecttyperel3.nim
Normal file
@@ -0,0 +1,12 @@
|
||||
discard """
|
||||
output: '''OK'''
|
||||
"""
|
||||
#bug #5632
|
||||
type
|
||||
Option*[T] = object
|
||||
|
||||
proc point*[A](v: A, t: typedesc[Option[A]]): Option[A] =
|
||||
discard
|
||||
|
||||
discard point(1, Option)
|
||||
echo "OK"
|
||||
Reference in New Issue
Block a user