Boo

CompilerGeneratedExtensions.BeginInvoke is ambiguous

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: 0.7.7
  • Fix Version/s: 0.7.8
  • Component/s: Compiler
  • Labels:
    None
  • Environment:
    #D/Windows, Mono/Linux
  • Number of attachments :
    2

Description

The compiler generated extension "BeginInvoke" is ambiguous when generated for methods that differ only by return type.
The original testcase follows; a more descriptive testcase is attached as BOO-831.boo.

Adding the line "Next tune..." results in BCE0004 in the BeginInvoke line. But problem is really that TimeRemaining should be TimeRemaining()

partial class MainForm:
...
        def ShowValues ():
                ValuesEdit.Text = \
...
                        "Tune value: " + Tune.CurrentTuneValue ().ToString () + "\n" + \
                        "Next tune:  " + Tune.TimeRemaining.ToString ()       + "\n" + \
                        ""
...

        private def RunBtnCheckedChanged(sender as object, e as
System.EventArgs):
...
                _RunResult = RunThread.BeginInvoke()
...

        def RunThread():
                Running = true
...

static class Tune:
...
        static def TimeRemaining ():
                return NextTuneTime - DateTime.Now
  1. AsyncMacro.cs
    05/Jun/07 3:03 PM
    3 kB
    Avishay Lavie
  2. BOO-831.boo
    25/May/07 4:50 AM
    0.5 kB
    Avishay Lavie

Issue Links

Activity

Hide
Avishay Lavie added a comment -

Attached a compact testcase that explains the error.

Show
Avishay Lavie added a comment - Attached a compact testcase that explains the error.
Hide
Avishay Lavie added a comment -

Updated title and description to more accurately describe problem.

Show
Avishay Lavie added a comment - Updated title and description to more accurately describe problem.
Hide
Cedric Vivier added a comment -

maybe a long-term solution to this would be to finally implement inlining as first thought here :
http://osdir.com/ml/lang.boo.devel/2005-09/msg00106.html (thx Avish for the link)

and here :
http://jira.codehaus.org/browse/BOO-534

Show
Cedric Vivier added a comment - maybe a long-term solution to this would be to finally implement inlining as first thought here : http://osdir.com/ml/lang.boo.devel/2005-09/msg00106.html (thx Avish for the link) and here : http://jira.codehaus.org/browse/BOO-534
Hide
Avishay Lavie added a comment -

Sorry - didn't see this was already taken.

Show
Avishay Lavie added a comment - Sorry - didn't see this was already taken.
Hide
Avishay Lavie added a comment - - edited

Preliminary research shows that Mono has no problem with overloads of BeginInvoke, but MS.NET still does.

I'm attaching a macro that implements simple asynchronous calls, thus:

# invoke Foo asynchronously with a callback 
async Foo(parameters...):
  print "Called back"

This isn't exactly what's needed to replace the BeginInvoke overloads, but if we're going to implement MetaMethods as described in the links Cedric posted, the code will probably be very similar.

Cedric - it's all yours

Show
Avishay Lavie added a comment - - edited Preliminary research shows that Mono has no problem with overloads of BeginInvoke, but MS.NET still does. I'm attaching a macro that implements simple asynchronous calls, thus:
# invoke Foo asynchronously with a callback 
async Foo(parameters...):
  print "Called back"
This isn't exactly what's needed to replace the BeginInvoke overloads, but if we're going to implement MetaMethods as described in the links Cedric posted, the code will probably be very similar. Cedric - it's all yours
Hide
Rodrigo B. de Oliveira added a comment -

Fixed in the repository.

Show
Rodrigo B. de Oliveira added a comment - Fixed in the repository.

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: