nim-lang / Nim

Nim is a statically typed compiled systems programming language. It combines successful concepts from mature languages like Python, Ada and Modula. Its design focuses on efficiency, expressiveness, and elegance (in that order of priority).
https://nim-lang.org
Other
16.63k stars 1.47k forks source link

test disabling generic matches to empty containers except @[] #24397

Open metagn opened 4 weeks ago

metagn commented 4 weeks ago

More or less correct (except untyped/typed failing and const arr = [] still working) but not the right solution. Fixes #23496 but not #23199 or #23534.

The right solution is to whitelist empty containers in specific contexts like #22716, specifically:

Sounds nice in principle but a fair bit of a refactor if we also include things like uninstantiated routines and maybe there are cases where the codegen depends on empty types. And there is stuff like typeof(@[]) etc.