mirror of
https://github.com/nim-lang/Nim.git
synced 2025-12-30 18:02:05 +00:00
* 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:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user