Don't consider tyAnd/tyNot/tyOr/tyAnything as generic (#8700)
* Don't consider tyAnd/tyNot/tyOr/tyAnything as generic `containsGenericType` was too shallow and didn't check all the branches. The resulting half-processed nodes are often simplified by the constant folding pass but when that's not possible we get a nasty error during codegen. Fixes #8693 * Move the blame onto the semFold pass Slightly better evaluation of `is` forms.
This commit is contained in:
parent
3e7aaa7087
commit
a87341775a
3 changed files with 63 additions and 17 deletions
|
|
@ -352,6 +352,11 @@ proc isOpImpl(c: PContext, n: PNode, flags: TExprFlags): PNode =
|
|||
res = t.kind == tyProc and
|
||||
t.callConv == ccClosure and
|
||||
tfIterator notin t.flags
|
||||
of "iterator":
|
||||
let t = skipTypes(t1, abstractRange)
|
||||
res = t.kind == tyProc and
|
||||
t.callConv == ccClosure and
|
||||
tfIterator in t.flags
|
||||
else:
|
||||
res = false
|
||||
else:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue