[Bro-Dev] #395: Cannot add global to module if it already exists in global namespace

Bro Tracker bro at tracker.bro-ids.org
Wed Jun 22 09:03:13 PDT 2011


#395: Cannot add global to module if it already exists in global namespace
----------------------+------------------------
  Reporter:  gregor   |      Owner:
      Type:  Problem  |     Status:  new
  Priority:  Normal   |  Milestone:  Bro1.7
 Component:  Bro      |    Version:  git/master
Resolution:           |   Keywords:
----------------------+------------------------
Changes (by seth):

 * milestone:  Bro1.6 => Bro1.7


Comment:

 Since this generally works now (for variables and types) I'm going to push
 the ticket back.  I'm leaving it open though because we should still
 address the fact that you can't access the same-named global variable or
 type from inside of a module that uses the same name.

 Here's my little test script for trying to access the global values and
 types:

 {{{
 global a = 1;
 type Test: count;

 module FOO;
 export {
         type Test: string;
         global a = 2;
         global b: Test = "test";
         global c: GLOBAL::Test = 5;
 }

 print a;
 print GLOBAL::a;
 print b;
 print c;
 }}}

 This should print out:

 {{{
 2
 1
 test
 c
 }}}

 But instead it currently fails with this error:

 {{{
 ./test33.bro, line 9: error: identifier not defined: GLOBAL::Test
 error and ./test33.bro, line 9
    (error and 5): error, arithmetic mixed with non-arithmetic
 ./test33.bro, line 13: error: unknown identifier GLOBAL::a, at or near
 "GLOBAL::a"
 }}}

-- 
Ticket URL: <http://tracker.bro-ids.org/bro/ticket/395#comment:2>
Bro Tracker <http://tracker.bro-ids.org/bro>
Bro Issue Tracker



More information about the bro-dev mailing list