[ nice-Bugs-1163887 ] package variable is visible around imports

"SourceForge.net" <[email protected]> Tue, 15 Mar 2005 10:40:50 -0800
Newsgroups gmane.comp.lang.nice.devel
Message-ID <[email protected]>
Bugs item #1163887, was opened at 2005-03-15 18:03
Message generated for change (Comment added) made by bonniot
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=112788&aid=1163887&group_id=12788

Category: None
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: Artem Gr Kozarezov (artemgr)
Assigned to: Nobody/Anonymous (nobody)
Summary: package variable is visible around imports

Initial Comment:
The following simple program:

package a;
void fun( StringBuffer buf ) = buf.append(
STATIC_VARIABLE );
let String STATIC_VARIABLE = "foo";

package b;
void fun( StringBuffer buf ) = buf.append(
STATIC_VARIABLE );
let String STATIC_VARIABLE = "bar";

package c;
import a;
import b;

when compiled from scratch with "nicec c" or when
recompiled with "nicec -R c" produces the following error:

E:\tmp\bug\b\b.nice: line 2, column 44:
Ambiguity for symbol STATIC_VARIABLE. Possibilities are :
java.lang.String STATIC_VARIABLE
java.lang.String STATIC_VARIABLE
compilation failed with 1 error


----------------------------------------------------------------------

>Comment By: Daniel Bonniot (bonniot)
Date: 2005-03-15 19:40

Message:
Logged In: YES 
user_id=88952

The testsuite compiles each package as it comes by default,
but you can postpone it with the 'dontcompile' keyword. In
this case it looks like you want:

/// package a dontcompile
...
/// package b dontcompile


----------------------------------------------------------------------

Comment By: Artem Gr Kozarezov (artemgr)
Date: 2005-03-15 18:08

Message:
Logged In: YES 
user_id=289741

I've tried to repeat the error in testsuite, but apparently
it compiles every package separately...
Here is my testsuite, just in case:


/// PASS
  /// package a
  /// Toplevel
void fun( StringBuffer buf ) = buf.append( STATIC_STRING );
let String STATIC_STRING = "foo1";
let String[] STATIC_ARRAY = [ "foo1", "bar1" ];

  /// package b
  /// Toplevel
void fun( StringBuffer buf ) = buf.append( STATIC_STRING );
let String STATIC_STRING = "foo2";
let String[] STATIC_ARRAY = [ "foo2", "bar2" ];

  /// package c import a,b
  /// Toplevel
void notUsed() {}


----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=112788&aid=1163887&group_id=12788


-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click