make tests green again

This commit is contained in:
Andreas Rumpf 2018-02-03 07:57:47 +01:00
commit 992fd38487
2 changed files with 16 additions and 20 deletions

View file

@ -1859,22 +1859,22 @@ proc paramTypesMatchAux(m: var TCandidate, f, a: PType,
var r = typeRel(m, f, a) var r = typeRel(m, f, a)
when false: # This special typing rule for macros and templates is not documented
# This special typing rule for macros and templates is not documented # anywhere and breaks symmetry. It's hard to get rid of though, my
# anywhere and breaks symmetry. # custom seqs example fails to compile without this:
if r != isNone and m.calleeSym != nil and if r != isNone and m.calleeSym != nil and
m.calleeSym.kind in {skMacro, skTemplate}: m.calleeSym.kind in {skMacro, skTemplate}:
# XXX: duplicating this is ugly, but we cannot (!) move this # XXX: duplicating this is ugly, but we cannot (!) move this
# directly into typeRel using return-like templates # directly into typeRel using return-like templates
incMatches(m, r) incMatches(m, r)
if f.kind == tyStmt: if f.kind == tyStmt:
return arg return arg
elif f.kind == tyTypeDesc: elif f.kind == tyTypeDesc:
return arg return arg
elif f.kind == tyStatic: elif f.kind == tyStatic:
return arg.typ.n return arg.typ.n
else: else:
return argSemantized # argOrig return argSemantized # argOrig
# If r == isBothMetaConvertible then we rerun typeRel. # If r == isBothMetaConvertible then we rerun typeRel.
# bothMetaCounter is for safety to avoid any infinite loop, # bothMetaCounter is for safety to avoid any infinite loop,

View file

@ -1,10 +1,6 @@
discard """ discard """
disabled: "true"
""" """
# disabled: relied on undocumented overloading rules. Too much work
# to make this sane.
import macros, strUtils import macros, strUtils
proc symToIdent(x: NimNode): NimNode = proc symToIdent(x: NimNode): NimNode =