[nem-bug] [Nemerle 0000626]: Quoted declaration of method override
results in compile-time error
feedback at nemerle.org
feedback at nemerle.org
Sat Feb 25 21:33:58 CET 2006
A NOTE has been added to this issue.
======================================================================
<http://nemerle.org/bugs/view.php?id=626>
======================================================================
Reported By: OysterDva
Assigned To:
======================================================================
Project: Nemerle
Issue ID: 626
Category: Compiler (parser/macros engine)
Reproducibility: always
Severity: crash
Priority: normal
Status: new
======================================================================
Date Submitted: 02-25-2006 21:23 CET
Last Modified: 02-25-2006 21:33 CET
======================================================================
Summary: Quoted declaration of method override results in
compile-time error
Description:
Definition of method override using TypeBuilder.Define() and quoting fails
if base class contains generic method with the same name/signature and
value of template parameter type returned.
For example, imagine we have the following class declared in C# (as I
understand, it's impossible to declare such class in Nemerle):
namespace NS
{
public class Test
{
virtual public object DoIt()
{
return null;
}
// Comment this method and error will go away
static public T DoIt<T>()
{
return default(T);
}
}
}
Here we have two methods with name DoIt() and similar signatures - one is
virtual and another one is static method with generic type parameter.
Now look at the following macro code which creates type inherited from
Test:
macro Reproduce1()
{
def ctx = Nemerle.Macros.ImplicitCTX();
def t = ctx.Env.Define(<[ decl: public class TestInherit : NS.Test {}
]>);
// This LOC causes an error to happen
t.Define(<[ decl: override public DoIt() : object { null } ]>);
t.Compile();
<[ () ]>
}
When we're using this macro, the following compile-time error occurs:
"`override' specified on method TestInherit.DoIt() : System.Object, but
there is no method with this signature in parent to override"
If we'll comment static method in Test class then everything will be
compiled without any error.
======================================================================
----------------------------------------------------------------------
nazgul - 02-25-06 21:29
----------------------------------------------------------------------
Does it also happen when you are not using macros, but just define such
class manually?
----------------------------------------------------------------------
OysterDva - 02-25-06 21:33
----------------------------------------------------------------------
Yep - I've just checked it.
Btw, sorry if severity level will be too high - using mantis for the first
time :)
Issue History
Date Modified Username Field Change
======================================================================
02-25-06 21:23 OysterDva New Issue
02-25-06 21:23 OysterDva File Added: src.txt
02-25-06 21:29 nazgul Note Added: 0001106
02-25-06 21:33 OysterDva Note Added: 0001107
======================================================================
More information about the bugs
mailing list