[Mono-bugs] [Bug 378189] gmcs requires void-returning invocation in lambda expression

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Sun Jul 6 15:41:47 EDT 2008


User cmarshall at pacificbiosciences.com added comment

--- Comment #5 from Casey Marshall <cmarshall at pacificbiosciences.com>  2008-07-06 13:41:45 MDT ---
The exact issue is in lambda.cs, ContextualReturn.DoResolve. If the expression
is an invocation, and the containing context resolves to `void', it explicitly
tests if the return type of the invocation is `void'.

I believe this is incorrect, though it does resolve another bug (Bug 370577),
where resolving same-named methods fails -- this happens to resolve that bug
because one of the methods in the test case takes an Action<T>, and thus would
require a void expression, which the lambda method doesn't match. From the test
case, it's obvious that only one `Foo' method is appropriate, since it's being
called where it is returning a value (of type string). It's a problem of
overload resolution given that one of the methods is generic.

The implementation also now seems to contradict the comments above that class
describing its purpose: that a contextual return behaves as either `return
expr()' or as `expr(); return;', depending on the containing context.

Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.

More information about the mono-bugs mailing list