Restrict ptr/ref to ptr/ref implicit conversion (#10411)

* Restrict ptr/ref to ptr/ref implicit conversion

Fixes #10409

* Make the ptr conversions explicit in db_odbc
This commit is contained in:
LemonBoy 2019-01-22 11:17:20 +01:00 • committed by Andreas Rumpf
commit 6825430831
3 changed files with 18 additions and 6 deletions

View file

@ -1316,7 +1316,7 @@ proc typeRelImpl(c: var TCandidate, f, aOrig: PType,
if typeRel(c, f.sons[i], a.sons[i]) == isNone: return isNone
result = typeRel(c, f.lastSon, a.lastSon, flags + {trNoCovariance})
subtypeCheck()
if result <= isConvertible: result = isNone
if result <= isIntConv: result = isNone
elif tfNotNil in f.flags and tfNotNil notin a.flags:
result = isNilConversion
elif a.kind == tyNil: result = f.allowsNil