mirror of
https://github.com/xomboverlord/ldc.git
synced 2026-03-31 17:19:02 +02:00
[svn r362] Started merging the old 'test' dir as well as the newer 'tangotests' dir into 'tests/mini' and 'tests/minicomplex'.
This commit is contained in:
47
tests/mini/classes9.d
Normal file
47
tests/mini/classes9.d
Normal file
@@ -0,0 +1,47 @@
|
||||
module classes9;
|
||||
|
||||
class C
|
||||
{
|
||||
}
|
||||
|
||||
class D : C
|
||||
{
|
||||
}
|
||||
|
||||
class E
|
||||
{
|
||||
}
|
||||
|
||||
class F : E
|
||||
{
|
||||
}
|
||||
|
||||
void main()
|
||||
{
|
||||
{
|
||||
D d = new D;
|
||||
{
|
||||
C c = d;
|
||||
assert(c !is null);
|
||||
D d2 = cast(D)c;
|
||||
assert(d2 !is null);
|
||||
E e = cast(E)d;
|
||||
assert(e is null);
|
||||
F f = cast(F)d;
|
||||
assert(f is null);
|
||||
}
|
||||
}
|
||||
{
|
||||
F f = new F;
|
||||
{
|
||||
E e = f;
|
||||
assert(e !is null);
|
||||
F f2 = cast(F)e;
|
||||
assert(f2 !is null);
|
||||
C c = cast(C)f;
|
||||
assert(c is null);
|
||||
D d2 = cast(D)f;
|
||||
assert(d2 is null);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user