XSharpPublic
XSharpPublic copied to clipboard
Inheriting more interfaces results to ambiguous warning
The following code
interface ITest inherit ITest1, ITest2
end interface
interface ITest1
property Caption as string get set
method Start() as void
end interface
interface ITest2
property Caption as string get set
method Start() as void
end interface
class TestClass implements ITest
property Caption as string auto get set := "Test"
method Start() as void
return
end class
function Start() as void strict
var test := (ITest)TestClass{}
test.Start()
test.Caption := "New Caption"
return
When compiling this code I get in the line with test.Start() and test.Caption errors and warnings:
C:\Projects\Tests\XSharpSlowTests\XSharpTests\Program.prg(31,2): error XS0121: The call is ambiguous between the following methods or properties: 'ITest1.Start()' and 'ITest2.Start()'
C:\Projects\Tests\XSharpSlowTests\XSharpTests\Program.prg(32,2): warning XS9043: 'Caption' is ambiguous. Could be Property 'ITest1.Caption' in XSharpTests or Property 'ITest2.Caption' in XSharpTests. Using the first one.
It looks like #1742