Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
resolve: report duplicate module definitions
add_child() is responsible for reporting errors about type, value, and module duplicate definitions. Although it checks for all three, it uses namespace_to_str() to convert a Namespace value into a string before printing an error like: error: duplicate definition of type `foo` ^^^^ note: first definition of type foo here: ^^^^ Unfortunately, this string can only be one of "type" or "value" (corresponding to TypeNS and ValueNS respectively), and it reports duplicate modules as duplicate types. To alleviate the problem, define a special NamespaceError enum to define more specialized errors, and use it instead of attempting to reuse the Namespace enum. Reported-by: Corey Richardson <corey@octayn.net> Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com>
- Loading branch information
Showing
2 changed files
with
27 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters