Fix #4020; Better handling of templates within concepts

This commit is contained in:
Zahary Karadjov 2017-06-19 20:07:26 +03:00 • committed by Andreas Rumpf
commit 8f4b374327
5 changed files with 65 additions and 2 deletions

View file

@ -1761,7 +1761,8 @@ proc semStmtList(c: PContext, n: PNode, flags: TExprFlags): PNode =
else:
var expr = semExpr(c, n.sons[i], flags)
n.sons[i] = expr
if c.matchedConcept != nil and expr.typ != nil:
if c.matchedConcept != nil and expr.typ != nil and
(nfFromTemplate notin n.flags or i != last):
case expr.typ.kind
of tyBool:
if expr.kind == nkInfix and