fixes #21360; discarding empty seqs/arrays now raises errors (#21374)

* discarding empty seqs now raises errors

* the same goes for sets
This commit is contained in:
ringabout 2023-02-16 10:23:35 +08:00 • committed by GitHub
commit fc7385bfda
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 25 additions and 9 deletions

View file

@ -1,5 +1,5 @@
discard """
errormsg: "internal error: invalid kind for lastOrd(tyEmpty)"
errormsg: "statement returns no value that can be discarded"
"""
var q = false
discard (if q: {} else: {})