Open shirleyquirk opened 2 years ago
More and more I'm off the opinion that we should "cache" generic instantiations only so far as required to prevent endless recursions in instantiations and then in a pre-linking step merge duplicated instantiations. This is what Borland C++ did with C++ templates and I don't remember complaints. It's conceptually simple and worked well.
Example
lib.nim
main.nim
Current Output
please check whether the problem still exists in git head before posting, see rebuilding the compiler.
Expected Output
unearthed by https://forum.nim-lang.org/t/8561 caused user no end of confusion when an unexported (and undocumented) type in a dependency of a dependency was being printed in an error message.
behaviour exist in 1.6,1.4,1.2,1.0,0.20...
Nim Compiler Version 1.7.1 [Linux: amd64] Compiled at 2021-10-30 Copyright (c) 2006-2021 by Andreas Rumpf
git hash: f755e452d2a2c7656f07793b7f01dc654a7c5253