File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -532,7 +532,7 @@ impl ReferenceTable {
532532 ) {
533533 fn get_parent_generic_component ( namespace : & Namespace ) -> Option < Symbol > {
534534 let target = namespace. get_symbol ( ) ?;
535- if target. has_generic_paramters ( ) {
535+ if target. has_generic_paramters ( ) || target . has_generic_consts ( ) {
536536 Some ( target)
537537 } else {
538538 get_parent_generic_component ( & target. namespace )
Original file line number Diff line number Diff line change @@ -340,7 +340,9 @@ impl Symbol {
340340 pub fn generic_maps ( & self ) -> Vec < GenericMap > {
341341 let mut ret = Vec :: new ( ) ;
342342
343- let generic_instances = if matches ! ( self . kind, SymbolKind :: GenericInstance ( _) ) {
343+ let generic_instances = if matches ! ( self . kind, SymbolKind :: GenericInstance ( _) )
344+ || ( !self . has_generic_paramters ( ) && self . has_generic_consts ( ) )
345+ {
344346 & vec ! [ self . id]
345347 } else {
346348 & self . generic_instances
Original file line number Diff line number Diff line change @@ -6231,6 +6231,26 @@ fn undefined_identifier() {
62316231
62326232 let errors = analyze ( code) ;
62336233 assert ! ( errors. is_empty( ) ) ;
6234+
6235+ let code = r#"
6236+ proto package a_proto_pkg {
6237+ type T;
6238+ }
6239+ package a_pkg::<W: u32> for a_proto_pkg {
6240+ type T = logic<W>;
6241+ }
6242+ package b_pkg {
6243+ gen W: u32 = 1 + 1;
6244+ alias package a = a_pkg::<W>;
6245+ }
6246+ package c_pkg {
6247+ import b_pkg::a::T;
6248+ const C: T = 0 as T;
6249+ }
6250+ "# ;
6251+
6252+ let errors = analyze ( code) ;
6253+ assert ! ( errors. is_empty( ) ) ;
62346254}
62356255
62366256#[ test]
You can’t perform that action at this time.
0 commit comments