@@ -226,7 +226,10 @@ def apply(self, node, options=None):
226
226
# the ancestor Routine. This avoids issues like #2424 when
227
227
# applying ParallelLoopTrans to loops containing inlined calls.
228
228
if ancestor_table is not scope .symbol_table :
229
- ancestor_table .merge (scope .symbol_table )
229
+ try :
230
+ ancestor_table .merge (scope .symbol_table )
231
+ except SymbolError as err :
232
+ raise InternalError ("No escape" ) from err
230
233
replacement = type (scope .symbol_table )()
231
234
scope .symbol_table .detach ()
232
235
replacement .attach (scope )
@@ -673,7 +676,8 @@ def validate(self, node, options=None):
673
676
f"Routine '{ routine .name } ' cannot be inlined because it "
674
677
f"has a named argument '{ arg } ' (TODO #924)." )
675
678
676
- table = node .scope .symbol_table
679
+ parent_routine = node .ancestor (Routine )
680
+ table = parent_routine .symbol_table # node.scope.symbol_table
677
681
routine_table = routine .symbol_table
678
682
679
683
for sym in routine_table .datasymbols :
@@ -693,7 +697,10 @@ def validate(self, node, options=None):
693
697
raise TransformationError (
694
698
f"Routine '{ routine .name } ' cannot be inlined because it "
695
699
f"contains a Symbol '{ sym .name } ' with an UnknownInterface:"
696
- f" '{ sym .datatype .declaration } '" )
700
+ f" '{ sym .datatype .declaration } '. You may be able to work "
701
+ f"around this limitation by adding the name of the module "
702
+ f"containing this Symbol to RESOLVE_IMPORTS in the "
703
+ f"transformation script." )
697
704
# Check that there are no static variables in the routine (because
698
705
# we don't know whether the routine is called from other places).
699
706
if (isinstance (sym .interface , StaticInterface ) and
0 commit comments