fix #8129 by calling semExpr in semIs if node is strLit (#8130)

* call `semExpr` in `semIs` if node is `strLit`, fixes #8129

In case the second son of the node in `semIs` is of kind `strLit`, we
now call `semExpr` to set the `typ` field of that node.

Also removes the `t2 != tyTypeDesc` check in `isOpImpl`, since the
kind of `n[2]` is already assertet with the `internalAssert`.

* reintroduce check for `t2.kind != tyTypeDesc` to fix test case

The `internalAssert` in the `isOpImpl` doesn't check
`n.sons[2].typ.kind` as I previously read, but rather
`n.sons[2].kind`. Therefore the check for `tyTypeDesc` here is
useful. Otherwise the last test case in `isopr.nim` fails.

Also removes the flag `efDetermineType` from the call to `semExpr`.
This commit is contained in:
Vindaar
2018-06-29 16:34:47 +02:00
committed by Andreas Rumpf
parent ae69e571e1
commit 898a4bc4fa

View File

@@ -393,6 +393,8 @@ proc semIs(c: PContext, n: PNode, flags: TExprFlags): PNode =
# When the right-hand side is an explicit type, we must
# not allow regular values to be matched against the type:
liftLhs = false
else:
n.sons[2] = semExpr(c, n[2])
var lhsType = n[1].typ
if lhsType.kind != tyTypeDesc: