Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiple imports override each other #50

Closed
lochotzke opened this issue Jan 17, 2019 · 1 comment
Closed

Multiple imports override each other #50

lochotzke opened this issue Jan 17, 2019 · 1 comment

Comments

@lochotzke
Copy link

I extended the import_imported.asn test file.

-- Import imported type and value.

A DEFINITIONS AUTOMATIC TAGS ::=

BEGIN

    EXPORTS ALL;

    Type ::= INTEGER

    value Type ::= 5

END


B DEFINITIONS AUTOMATIC TAGS ::=

BEGIN

    IMPORTS

        Type,
        value
    FROM A;

    AnotherType ::= Type

    anotherValue AnotherType ::= value

END


C DEFINITIONS AUTOMATIC TAGS ::=

BEGIN

    IMPORTS

        Type,
        anotherValue
    FROM B;

    AndAnotherType ::= Type

    andAnotherValue AndAnotherType ::= anotherValue

END


D DEFINITIONS AUTOMATIC TAGS ::=

BEGIN

    IMPORTS

        Type
    FROM B
        value
    FROM B;

    AnotherType ::= Type

    anotherValue AnotherType ::= value

END

The first import Type gets overwritten by the second one value which leads to:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python3.7/site-packages/asn1tools/compiler.py", line 354, in compile_files
    numeric_enums)
  File "/usr/local/lib/python3.7/site-packages/asn1tools/compiler.py", line 284, in compile_dict
    numeric_enums),
  File "/usr/local/lib/python3.7/site-packages/asn1tools/codecs/ber.py", line 1621, in compile_dict
    return Compiler(specification, numeric_enums).process()
  File "/usr/local/lib/python3.7/site-packages/asn1tools/codecs/compiler.py", line 196, in process
    module_name)
  File "/usr/local/lib/python3.7/site-packages/asn1tools/codecs/ber.py", line 1430, in process_type
    module_name)
  File "/usr/local/lib/python3.7/site-packages/asn1tools/codecs/ber.py", line 1549, in compile_type
    module_name)
  File "/usr/local/lib/python3.7/site-packages/asn1tools/codecs/ber.py", line 1542, in compile_implicit_type
    module_name)
  File "/usr/local/lib/python3.7/site-packages/asn1tools/codecs/compiler.py", line 583, in compile_user_type
    module_name))
  File "/usr/local/lib/python3.7/site-packages/asn1tools/codecs/compiler.py", line 770, in lookup_type_descriptor
    return self.lookup_in_modules('types', 'type', type_name, module_name)
  File "/usr/local/lib/python3.7/site-packages/asn1tools/codecs/compiler.py", line 767, in lookup_in_modules
    module_name))
asn1tools.errors.CompileError: Type 'Type' not found in module 'D'.
@eerimoq
Copy link
Owner

eerimoq commented Jan 17, 2019

Fixed in version 0.145.1.

@eerimoq eerimoq closed this as completed Jan 18, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants