marvin-zhao / pyang

Automatically exported from code.google.com/p/pyang
0 stars 0 forks source link

Type identifier collision in the submodules of the module #17

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
I am not sure whether it's an issue or it is correct behavior. I have a module:

module composite {
    namespace "urn:composite";
    prefix c;

    include submod1 {
    }    

    include submod2 {
    }    

}

which is splitted into 2 submodules:

submodule submod1 {
    belongs-to composite {
        prefix mod1;
    }

    typedef t1 {
        type string;
    }
}

and 

submodule submod2 {

    belongs-to composite {
        prefix mod;
    }

    container new {
    typedef t1 {
        type string;
    }
    }
}

In the submodule 'submod1' I define the top level type 't1' and then I try
to define the type with the same name (but not the top level type) in the
submodule 'submod2'. PYANG does not complain about this. Is it correct or
it also breaks identifier uniqueness?

Original issue reported on code.google.com by kur...@gmail.com on 27 Apr 2009 at 8:22

Attachments:

GoogleCodeExporter commented 9 years ago
This should be an error.  If this was all defined in one module, it would have 
been
an error.  Thus it is an error when the same definitions are split into 
submodules.

Original comment by mbj4...@gmail.com on 7 May 2009 at 8:35

GoogleCodeExporter commented 9 years ago

Original comment by mbj4...@gmail.com on 7 May 2009 at 9:51