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
|
source("TestHarness.bsh");
// same as 10 but in a package
package booga2;
class Foo10
{
Bar10 myBar;
// random instance stuff
assert( this instanceof booga2.Foo10 );
assert( Foo10.Bar10 instanceof bsh.ClassIdentifier );
assert( Bar10 instanceof bsh.ClassIdentifier );
static class Bar10 { }
void go() {
myBar = new Bar10();
assert( myBar instanceof Bar10 );
}
}
f=new Foo10();
assert( f instanceof booga2.Foo10 );
f.go();
// this is a strange case... we don't recurse namespace for explicit imports
//assert( f.myBar instanceof Foo10.Bar10 );
assert( f.myBar instanceof booga2.Foo10.Bar10 );
complete();
|