File tree Expand file tree Collapse file tree 2 files changed +29
-1
lines changed Expand file tree Collapse file tree 2 files changed +29
-1
lines changed Original file line number Diff line number Diff line change @@ -1393,7 +1393,7 @@ impl Index {
1393
1393
. and_then ( |qualifier| self . find_member ( qualifier, variable_name) ) )
1394
1394
// 'self' instance of a POUs init function
1395
1395
. or ( container_name
1396
- . rfind ( '_' )
1396
+ . rfind ( "__init_" )
1397
1397
. map ( |p| & container_name[ p + 1 ..] )
1398
1398
. and_then ( |qualifier| self . find_member ( qualifier, variable_name) ) )
1399
1399
}
Original file line number Diff line number Diff line change @@ -450,6 +450,34 @@ fn redeclaration_of_variables_from_super_super_is_an_error() {
450
450
" ) ;
451
451
}
452
452
453
+ #[ test]
454
+ fn underscore_separated_name_repetition_does_not_overflow_the_stack ( ) {
455
+ let diagnostics = parse_and_validate_buffered (
456
+ "
457
+ FUNCTION_BLOCK great_grandparent
458
+ END_FUNCTION_BLOCK
459
+
460
+ FUNCTION_BLOCK grandparent EXTENDS great_grandparent
461
+ VAR
462
+ x : INT := 10;
463
+ END_VAR
464
+ END_FUNCTION_BLOCK
465
+
466
+ FUNCTION_BLOCK parent EXTENDS grandparent
467
+ x := 100;
468
+ END_FUNCTION_BLOCK
469
+ " ,
470
+ ) ;
471
+
472
+ assert_snapshot ! ( diagnostics, @r"
473
+ warning[E049]: Illegal access to private member grandparent.x
474
+ ┌─ <internal>:12:13
475
+ │
476
+ 12 │ x := 100;
477
+ │ ^ Illegal access to private member grandparent.x
478
+ " ) ;
479
+ }
480
+
453
481
#[ test]
454
482
fn signature_mismatch_between_base_and_interface ( ) {
455
483
let diagnostics = parse_and_validate_buffered (
You can’t perform that action at this time.
0 commit comments