History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: BOO-992
Type: Bug Bug
Status: Resolved Resolved
Resolution: Fixed
Priority: Major Major
Assignee: Avishay Lavie
Reporter: Marcus Griep
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Boo

Compiler cannot disambiguate between non-generic and generic with the same name (including generic with a different number of generic parameters)

Created: 09/Apr/08 04:50 PM   Updated: 11/Apr/08 11:39 AM
Component/s: None
Affects Version/s: 0.8.1
Fix Version/s: 0.8.1

Time Tracking:
Not Specified

Issue Links:
Related

Testcase included: yes


 Description  « Hide
(forked from BOO-882)

The compiler cannot disambiguate between different callables with the similar signature, where the callables have a different number of generic parameters.

class Class:
  def Method(arg as int):
    return "regular method"

  def Method[of T](arg as T):
    return "generic method"

c = Class()
print c.Method(42)

The code above should print "regular method", but gives a "cannot resolve ambiguous member" error.

According to the C# spec, the most specific member should be selected - in this case, the one with no generic arguments.



 All   Comments   Work Log   Change History      Sort Order: Ascending order - Click to sort in descending order
Marcus Griep - 09/Apr/08 04:54 PM
A testcase:
public class Foo
{
    public static void Do(string s)
    {
        
    }

    public static void Do<T>(string s)
    {
        
    }
}

#Boo errors on this line:
Foo.Do("foo")

Gives this error:

BCE0004: Ambiguous reference 'Do': BooError.Foo.Do(string), BooError.Foo.Do(string)

Avishay Lavie - 11/Apr/08 11:39 AM
Resolved in r2919.
Thanks Marcus for adding testcases, I forgot to add mine (which were inferior anyway).