summaryrefslogtreecommitdiff
path: root/TAO/tests/IDL_Test/invalid_scoping2.idl
blob: 31ad7226f3c3510e0b77eff4bbc18dc34cefb866 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50

//=============================================================================
/**
 *  @file    invalid_scoping2.idl
 *
 *  This file contains examples of IDL code that has
 *  caused problems in the past for the TAO IDL
 *  compiler. This test is to make sure the problems
 *  stay fixed.
 */
//=============================================================================


// Ensure that scope ::A::B::target exists
// but doesn't contain enum numbers2.
// ::A::B::target should hide the ::A::target
// defined later when inside scope ::A::B.
module A {
  module B {
    module target {
      enum numbers1 {
        ONE
      };
    };
  };
};

// Ensure that enum ::A::target::numbers2 exists
// which should not be found inside scope B due
// to the internal "target" module above.
module A {
  module target {
    enum numbers2 {
      TWO
    };
  };
};

// Attempt to access global scope ::A::target::numbers2
// with a local (non-fully pathed) name target::numbers2
// from within ::A::B which DOES contain it's own target
// module that does NOT contain numbers2. THIS SHOULD NOT
// COMPILE OR LOCK-UP tao_idl. The two target modules are NOT
// the same module and thus the outer one is hidden by the
// closer local one.
module A {
  module B {
    typedef target::numbers2 myType;
  };
};