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

Key: BOO-831
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Rodrigo B. de Oliveira
Reporter: Jim Lewis
Votes: 0
Watchers: 0
Operations

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

CompilerGeneratedExtensions.BeginInvoke is ambiguous

Created: 24/May/07 06:28 PM   Updated: 11/Jun/07 04:19 PM
Component/s: Compiler
Affects Version/s: 0.7.7
Fix Version/s: 0.7.8

Time Tracking:
Not Specified

File Attachments: 1. File AsyncMacro.cs (3 kb)
2. File BOO-831.boo (0.5 kb)

Environment: #D/Windows, Mono/Linux
Issue Links:
Related
 


 Description  « Hide
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


 All   Comments   Work Log   Change History      Sort Order: Ascending order - Click to sort in descending order
Avishay Lavie - 25/May/07 04:50 AM
Attached a compact testcase that explains the error.

Avishay Lavie - 25/May/07 04:53 AM
Updated title and description to more accurately describe problem.

Cedric Vivier - 05/Jun/07 11:20 AM
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


Avishay Lavie - 05/Jun/07 02:53 PM
Sorry - didn't see this was already taken.

Avishay Lavie - 05/Jun/07 03:03 PM - 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


Rodrigo B. de Oliveira - 11/Jun/07 04:19 PM
Fixed in the repository.