Details
Description
Two test cases and corresponding errors follows...
interface ITest:
def DoSomething() as string
def DoSomething[of T]() as T
class Test(ITest):
def DoSomething() as string:
pass
def DoSomething[of T]() as T:
pass
Program.boo(10,9) : Error BCE0035: 'Test.DoSomething' conflicts with inherited member 'ITest.DoSomething'.
Program.boo(7,9) : Error BCE0035: 'Test.DoSomething' conflicts with inherited member 'ITest.DoSomething`1'.
class Test2Base:
virtual def DoSomething() as string:
pass
virtual def DoSomething[of T]() as T:
pass
class Test2(Test2Base):
def DoSomething() as string:
pass
def DoSomething[of T]() as T:
pass
Program.boo(12,32) : Error BCE0072: Overridden method 'Test2Base.DoSomething' has a return type of 'string' not 'Test2.DoSomething`1.T'.
Activity
| Field | Original Value | New Value |
|---|---|---|
| Testcase included | yes | |
| Fix Version/s | 0.8.2 [ 13814 ] | |
| Summary | problems distinguishing between generic and non-generic methods when overriding | Conflict between generic and non-generic methods overloads when return type is generic parameter |
| Assignee | Cedric Vivier [ cedricv ] |
| Status | Open [ 1 ] | Resolved [ 5 ] |
| Resolution | Fixed [ 1 ] |
Hmm.. I guess the errors are legit aren't they?
interface ITest: def DoSomething() as string def DoSomething[of T](x as T) as string class Test(ITest): def DoSomething() as string: pass def DoSomething[of T](x as T) as string: passWorks.