* 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:
parent
ae69e571e1
commit
898a4bc4fa
1 changed files with 2 additions and 0 deletions
|
|
@ -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:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue