X-Sharp / XSharpPublic

Public repository for the source code for the XSharp Compiler, Runtime, Project System and Tools.
Apache License 2.0
89 stars 36 forks source link

AmbiguousMatchException in Evaluate for methods included in an interface #1494

Closed hpetriffer closed 2 weeks ago

hpetriffer commented 2 weeks ago

If the code in Evaluate calls a method, which is also included in an interface, an AmbiguousMatchException is thrown. Eval works fine.

public interface IFormOwner
   public method SetProperty(symProperty as symbol, uValue as usual) as int strict
end interface

public class Test implements IFormOwner
   public method SetProperty(symProperty as symbol, uValue as usual) as int strict
        return 1
end class

function GetTest() as Test
    return Test{}

function ConvertToSymbol (u as usual) as usual
   return AsSymbol(u)

function Start() as void strict
   var cb1 := {||GetTest():SetProperty(ConvertToSymbol('x'), -1)}
    var res1 := Eval(cb1)
    Console.WriteLine(ie"{res1}")
   Console.ReadLine()

    var cs2 := "{||GetTest():SetProperty(ConvertToSymbol('x'), -1)}"
    var cb2 := Evaluate(cs2)
    var res2 := Eval(cb2)
    Console.WriteLine(ie"{res2}")

    return

XSharpTests.zip

RobertvanderHulst commented 2 weeks ago

Solved in attached macro compiler MacroCompiler.2.20.0.4.zip

RobertvanderHulst commented 2 weeks ago

Confirmed fixed by customer.