#64 IDLToCLSCompiler forgets typedefs from included IDLs

open
6
2006-01-02
2005-12-15
Rodolfo Campero
No

Before we get started, thank you for providing IIOP.NET.

It looks like IDLToCLSCompiler somehow "forgets"
typedefs declared in included IDLs.

The following example illustrates this (it's also
attached in a zip file):

8<--------------------------------------
// file a.idl
module A
{
interface IA
{
typedef string id_type;
};
};

8<--------------------------------------
// file b.idl
#include "a.idl"
module B
{
interface IB
{
typedef A::IA::id_type id_ia_type;
attribute id_ia_type id_ia;
};
};

8<--------------------------------------
compile this IDLs using:
IDLToCLSCompiler -basedir . sample a.idl b.idl

A "sample.dll" library should be generated, but instead
the following error message appears:

IDLToCLSCompiler -basedir . sample a.idl b.idl
processing file: a.idl
processing file: b.idl
exception encountered:
Ch.Elca.Iiop.IdlCompiler.Exceptions.InvalidIdlException:
attribute type not defined for attribute(s)
attribute(s) id_ia defined in IB (in module B)
at
Ch.Elca.Iiop.IdlCompiler.Action.MetaDataGenerator.visit(ASTattr_dcl
node, Object data)
at parser.ASTattr_dcl.jjtAccept(IDLParserVisitor
visitor, Object data)
at parser.SimpleNode.childrenAccept(IDLParserVisitor
visitor, Object data)
at
Ch.Elca.Iiop.IdlCompiler.Action.MetaDataGenerator.visit(ASTexport
node, Object data)
at parser.ASTexport.jjtAccept(IDLParserVisitor
visitor, Object data)
at parser.SimpleNode.childrenAccept(IDLParserVisitor
visitor, Object data)
at
Ch.Elca.Iiop.IdlCompiler.Action.MetaDataGenerator.visit(ASTinterface_body
node, Object data)
at
parser.ASTinterface_body.jjtAccept(IDLParserVisitor
visitor, Object data)
at
Ch.Elca.Iiop.IdlCompiler.Action.MetaDataGenerator.visit(ASTinterface_dcl
node, Object data)
at
parser.ASTinterface_dcl.jjtAccept(IDLParserVisitor
visitor, Object data)
at parser.SimpleNode.childrenAccept(IDLParserVisitor
visitor, Object data)
at
Ch.Elca.Iiop.IdlCompiler.Action.MetaDataGenerator.visit(ASTinterfacex
node, Object data)
at parser.ASTinterfacex.jjtAccept(IDLParserVisitor
visitor, Object data)
at parser.SimpleNode.childrenAccept(IDLParserVisitor
visitor, Object data)
at
Ch.Elca.Iiop.IdlCompiler.Action.MetaDataGenerator.visit(ASTdefinition
node, Object data)
at parser.ASTdefinition.jjtAccept(IDLParserVisitor
visitor, Object data)
at parser.SimpleNode.childrenAccept(IDLParserVisitor
visitor, Object data)
at
Ch.Elca.Iiop.IdlCompiler.Action.MetaDataGenerator.visit(ASTmodule
node, Object data)
at parser.ASTmodule.jjtAccept(IDLParserVisitor
visitor, Object data)
at parser.SimpleNode.childrenAccept(IDLParserVisitor
visitor, Object data)
at
Ch.Elca.Iiop.IdlCompiler.Action.MetaDataGenerator.visit(ASTdefinition
node, Object data)
at parser.ASTdefinition.jjtAccept(IDLParserVisitor
visitor, Object data)
at parser.SimpleNode.childrenAccept(IDLParserVisitor
visitor, Object data)
at
Ch.Elca.Iiop.IdlCompiler.Action.MetaDataGenerator.visit(ASTspecification
node, Object data)
at
parser.ASTspecification.jjtAccept(IDLParserVisitor
visitor, Object data)
at
Ch.Elca.Iiop.IdlCompiler.IDLToCLS.processFile(MetaDataGenerator
generator, String file)
at Ch.Elca.Iiop.IdlCompiler.IDLToCLS.MapIdl()
at Ch.Elca.Iiop.IdlCompiler.IDLToCLS.Main(String[] args)
make: *** [sample.dll] Error 2

Note that when both interfaces are placed inside the
same source file, the tool behaves correctly.

Best regards,
Rodolfo

Discussion

  • sample IDLs that illustrate the bug

     
    Attachments
    • priority: 5 --> 6
    • assigned_to: nobody --> dullmann
     
  • Logged In: YES
    user_id=660259

    Hi

    Thank you for finding this bug.
    You're right, the IDL to CLS compiler clears it's memory of
    the known types when starting with a new file (given as
    argument on the command line). This should prevent, that
    IIOP.NET sees types from a previous file (and it's
    includes) although the types are not visible in the current
    file (and it's includes).

    But this strategy doesn't work correctly for your case,
    because IIOP.NET doesn't reconsider the interface content
    of IA and therefore doesn't add the typedef id_type to the
    seen types again for the second run.

    I'll need some time to fix this problem.

    Sorry for this long delay.
    Best regards,
    Dominic