rasn icon indicating copy to clipboard operation
rasn copied to clipboard

Error compiling when importing parameterized type

Open zhouxt1 opened this issue 2 months ago • 0 comments

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.

zhouxt1 avatar Oct 17 '25 14:10 zhouxt1