[omniORB] IDL case sensitivity, omniidl2 vs. omniidl
Duncan Grisby
dgrisby@uk.research.att.com
Thu, 03 Feb 2000 13:50:54 +0000
On Thursday 3 February, Harri Pasanen wrote:
> module Dummy
> {
> struct Login
> {
> string host;
> string user;
> };
> interface Service
> {
> boolean login (in Login info);
> };
> };
> However, omniidl2 seems to compile it just fine, but omniidl outputs:
>
> dummy.idl:11: Use of `Login' clashes with identifier `login'
> dummy.idl:11: (`login' declared here)
> omniidl: 1 error.
> I'm not sure which is correct here, omniidl2 or omniidl?
omniidl is correct. In section 3.15.3 of the CORBA 2.3 spec, it says:
"Once a type identifier has been used anywhere within the scope of
an interface or valuetype, it may not be redefined within the scope
of that interface or valuetype. Use of type names within nested
scopes created by structs, unions, and exceptions, as well as within
the unnamed scope created by an operation parameter list, are for
these purposes considered to occur within the scope of the enclosing
interface or valuetype."
So, the use of Login within the operation's parameters is considered
to be a use within the Service interface, and therefore clashes with
the operation name login.
The solution is to qualify the type with Dummy::Login or
::Dummy::Login.
Cheers,
Duncan.
--
-- Duncan Grisby \ Research Engineer --
-- AT&T Laboratories Cambridge --
-- http://www.uk.research.att.com/~dpg1 --