Skip to content

Error compiling when importing parameterized type #503

Description

@zhouxt1

Hi,

I found this issue when I was trying to compile the NR RRC specification. Here is a simplified example

Foo DEFINITIONS AUTOMATIC TAGS ::=
BEGIN

S1 ::= SEQUENCE {
   c1 SetupRelease { BOOLEAN }
}

SetupRelease { ElementTypeParam } ::= CHOICE {
    release         NULL,
    setup           ElementTypeParam
}
END

Bar DEFINITIONS AUTOMATIC TAGS ::=
BEGIN
IMPORTS
   SetupRelease
FROM Foo;

S2 ::= SEQUENCE {
   c2 SetupRelease { BOOLEAN }
}
END

What happens is the compiler will try to import the SetupRelease from foo in module bar. However, there is no standalone definition of that parametrized type.
So it results in the following error.

error[E0432]: unresolved import `super::foo::SetupRelease`
  --> src/foo.rs:10:9
   |
10 |     use super::foo::SetupRelease;
   |         ^^^^^^^^^^^^^^^^^^^^^^^^ no `SetupRelease` in `foo::foo`

It should be an easy fix.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions