-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Labels
Description
The test case SimpleExtendTest does not generate the expected output:
base
exp {-> package='org.overture.ast.expressions'}
= {aa} [type]:stm.st1
;
extention
exp {-> package='org.overture.interpreter.ast.expressions'}
= {aa} [ee]:stm.st2
;
We would expect the extended tree to include an extended AAaExp (extended) which extends AAaExp (base), having the following fields:
type
ee
and the analysis to include analysis for this new class as well where the depth first visitor takes inherited fields into account.
The node is skipped in the extended generation in ExtensionGenerator2.includeClassesFromExtension where willGenerateExtensionFor excluded it.
hack to include it:
private static void includeClassesFromExtension(Environment result,
Environment ext, Environment base)
{
for (IClassDefinition cDef : ext.getClasses())
{
if (!willGenerateExtensionFor(cDef, base))
{
if (!isUtilityOrTemplateClass(cDef, ext))
{
cDef.setIsExtTree(true);
result.getClasses().add(cDef);
}
}
if(cDef.getName().toString().startsWith("AAaExp"))
{
cDef.setIsExtTree(true);
result.getClasses().add(cDef);
}
}
}
Reactions are currently unavailable