duplicate import of same module

Bug #867232 reported by Matthias Brantner
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Zorba
New
Medium
Markos Zaharioudakis

Bug Description

If compiling the attached main module (main.xq), an error is raised because of a duplicate function declaration of utils:bar.
In this example (a imports b, a imports utils, and b imports utils). The problem is that a imports utils without a location hint and b imports utils with a location hint. Hence, the translator doesn't detect that the same entity is imported multiple times.

IMHO, the translator either needs to detect that the same entity is imported or the error message must indicate why the same function is declared twice.

Revision history for this message
Matthias Brantner (matthias-brantner) wrote :

The file dup.tgz was added: None

Revision history for this message
Chris Hillery (ceejatec) wrote :

We already have a cache of loaded module files. What we could do is ensure that the key for that cache is the actual URL which was read. We kind of try to do this already, but only using the URIs as derived from the import statements themselves. We don't currently take into account the URI resolver mechanism, which usually rewrites those URIs to something else.

If this sounds like a reasonable approach, the bug could be assigned to me.

Changed in zorba:
importance: High → Medium
Chris Hillery (ceejatec)
tags: removed: parser-normalization
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.