parent
29226ce5b2
commit
51d81c4e23
2 changed files with 14 additions and 1 deletions
|
|
@ -1145,7 +1145,12 @@ proc typeRelImpl(c: var TCandidate, f, aOrig: PType,
|
||||||
fRange = prev
|
fRange = prev
|
||||||
let ff = f.sons[1].skipTypes({tyTypeDesc})
|
let ff = f.sons[1].skipTypes({tyTypeDesc})
|
||||||
let aa = a.sons[1].skipTypes({tyTypeDesc})
|
let aa = a.sons[1].skipTypes({tyTypeDesc})
|
||||||
result = typeRel(c, ff, aa)
|
|
||||||
|
if f.sons[0].kind != tyGenericParam and aa.kind == tyEmpty:
|
||||||
|
result = isGeneric
|
||||||
|
else:
|
||||||
|
result = typeRel(c, ff, aa)
|
||||||
|
|
||||||
if result < isGeneric:
|
if result < isGeneric:
|
||||||
if nimEnableCovariance and
|
if nimEnableCovariance and
|
||||||
trNoCovariance notin flags and
|
trNoCovariance notin flags and
|
||||||
|
|
|
||||||
|
|
@ -38,3 +38,11 @@ var found: array[0..filesToCreate.high, bool]
|
||||||
|
|
||||||
echo found.len
|
echo found.len
|
||||||
|
|
||||||
|
# make sure empty arrays are assignable (bug #6853)
|
||||||
|
const arr1: array[0, int] = []
|
||||||
|
const arr2 = []
|
||||||
|
let arr3: array[0, string] = []
|
||||||
|
|
||||||
|
doAssert(arr1.len == 0)
|
||||||
|
doAssert(arr2.len == 0)
|
||||||
|
doAssert(arr3.len == 0)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue