[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Dotgnu-pnet-commits] CVS: cscctest/csharp/class method14.cs,NONE,1.1 me
From: |
Rhys Weatherley <address@hidden> |
Subject: |
[Dotgnu-pnet-commits] CVS: cscctest/csharp/class method14.cs,NONE,1.1 method14.il,NONE,1.1 method14.jl,NONE,1.1 Makefile.am,1.26,1.27 |
Date: |
Fri, 08 Nov 2002 19:07:05 -0500 |
Update of /cvsroot/dotgnu-pnet/cscctest/csharp/class
In directory subversions:/tmp/cvs-serv6792/csharp/class
Modified Files:
Makefile.am
Added Files:
method14.cs method14.il method14.jl
Log Message:
Test that child candidates always override "better" parent candidates.
--- NEW FILE ---
/*
* method14.cs - Test candidate overrides.
*
* Copyright (C) 2002 Free Software Foundation
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
using System;
public class Parent
{
public void Foo(int x) {}
}
public class Child : Parent
{
public void Foo(float x) {}
}
public class Test
{
public static void Main()
{
// Should call "Child.Foo(float)", not "Parent.Foo(int)".
Child c = new Child();
c.Foo(42);
}
}
--- NEW FILE ---
.assembly extern '.library'
{
.ver 0:0:0:0
}
.assembly '<Assembly>'
{
.ver 0:0:0:0
}
.module '<Module>'
.class public auto ansi 'Parent' extends ['.library']'System'.'Object'
{
.method public hidebysig instance void 'Foo'(int32 'x') cil managed
{
ret
.maxstack 0
} // method Foo
.method public hidebysig specialname rtspecialname instance void '.ctor'() cil
managed
{
ldarg.0
call instance void ['.library']'System'.'Object'::'.ctor'()
ret
.maxstack 1
} // method .ctor
} // class Parent
.class public auto ansi 'Child' extends 'Parent'
{
.method public hidebysig instance void 'Foo'(float32 'x') cil managed
{
ret
.maxstack 0
} // method Foo
.method public hidebysig specialname rtspecialname instance void '.ctor'() cil
managed
{
ldarg.0
call instance void 'Parent'::'.ctor'()
ret
.maxstack 1
} // method .ctor
} // class Child
.class public auto ansi 'Test' extends ['.library']'System'.'Object'
{
.method public static hidebysig void 'Main'() cil managed
{
.locals (class 'Child')
newobj instance void 'Child'::'.ctor'()
stloc.0
ldloc.0
ldc.i4.s 42
conv.r4
call instance void 'Child'::'Foo'(float32)
ret
.maxstack 2
} // method Main
.method public hidebysig specialname rtspecialname instance void '.ctor'() cil
managed
{
ldarg.0
call instance void ['.library']'System'.'Object'::'.ctor'()
ret
.maxstack 1
} // method .ctor
} // class Test
--- NEW FILE ---
.assembly extern '.library'
{
.ver 0:0:0:0
}
.assembly '<Assembly>'
{
.ver 0:0:0:0
}
.module '<Module>'
.class public auto ansi 'Parent' extends ['.library']'System'.'Object'
{
.method public hidebysig instance void 'Foo'(int32 'x') cil managed java
{
return
.locals 2
.maxstack 0
} // method Foo
.method public hidebysig specialname rtspecialname instance void '.ctor'() cil
managed java
{
aload_0
invokespecial instance void ['.library']'System'.'Object'::'.ctor'()
return
.locals 1
.maxstack 1
} // method .ctor
} // class Parent
.class public auto ansi 'Child' extends 'Parent'
{
.method public hidebysig instance void 'Foo'(float32 'x') cil managed java
{
return
.locals 2
.maxstack 0
} // method Foo
.method public hidebysig specialname rtspecialname instance void '.ctor'() cil
managed java
{
aload_0
invokespecial instance void 'Parent'::'.ctor'()
return
.locals 1
.maxstack 1
} // method .ctor
} // class Child
.class public auto ansi 'Test' extends ['.library']'System'.'Object'
{
.method public static hidebysig void 'Main'() cil managed java
{
new 'Child'
dup
invokespecial instance void 'Child'::'.ctor'()
astore_0
aload_0
bipush 42
i2f
invokespecial instance void 'Child'::'Foo'(float32)
return
.locals 1
.maxstack 2
} // method Main
.method public hidebysig specialname rtspecialname instance void '.ctor'() cil
managed java
{
aload_0
invokespecial instance void ['.library']'System'.'Object'::'.ctor'()
return
.locals 1
.maxstack 1
} // method .ctor
} // class Test
Index: Makefile.am
===================================================================
RCS file: /cvsroot/dotgnu-pnet/cscctest/csharp/class/Makefile.am,v
retrieving revision 1.26
retrieving revision 1.27
diff -C2 -r1.26 -r1.27
*** Makefile.am 20 Oct 2002 10:44:04 -0000 1.26
--- Makefile.am 9 Nov 2002 00:07:03 -0000 1.27
***************
*** 35,38 ****
--- 35,39 ----
method12.cs \
method13.cs \
+ method14.cs \
nested1.cs \
property1.cs \
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Dotgnu-pnet-commits] CVS: cscctest/csharp/class method14.cs,NONE,1.1 method14.il,NONE,1.1 method14.jl,NONE,1.1 Makefile.am,1.26,1.27,
Rhys Weatherley <address@hidden> <=
- Prev by Date:
[Dotgnu-pnet-commits] CVS: cscctest ChangeLog,1.111,1.112
- Next by Date:
[Dotgnu-pnet-commits] CVS: pnet/cscc/csharp cs_internal.h,1.10,1.11 cs_invoke.tc,1.12,1.13 cs_lookup.c,1.13,1.14
- Previous by thread:
[Dotgnu-pnet-commits] CVS: cscctest ChangeLog,1.111,1.112
- Next by thread:
[Dotgnu-pnet-commits] CVS: pnet/cscc/csharp cs_internal.h,1.10,1.11 cs_invoke.tc,1.12,1.13 cs_lookup.c,1.13,1.14
- Index(es):