[Mono-bugs] [Bug 353276] New: [gmcs] Lambda expressions don' t support the identity function

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Fri Jan 11 12:02:21 EST 2008


https://bugzilla.novell.com/show_bug.cgi?id=353276


           Summary: [gmcs] Lambda expressions don't support the identity
                    function
           Product: Mono: Compilers
           Version: SVN
          Platform: x86-64
        OS/Version: openSUSE 10.3
            Status: NEW
          Severity: Normal
          Priority: P5 - None
         Component: C#
        AssignedTo: mono-bugs at lists.ximian.com
        ReportedBy: jpryor at novell.com
         QAContact: mono-bugs at lists.ximian.com
          Found By: ---


gmcs doesn't support lambda functions:

    Func<T,T> f = n => n;

results in:

id.cs(12,36): error CS0029: Cannot implicitly convert type `T' to `T'
id.cs(12,36): The generic parameter `T' of `Test.Foo<T>()' cannot be converted
to the generic parameter `T' of `Test.<>c__CompilerGenerated0<T>' (in the
previous error)
id.cs(12,36): error CS1662: Cannot convert `lambda expression' to delegate type
`System.Func<T,T>' because some of the return types in the block are not
implicitly convertible to the delegate return type
Compilation failed: 2 error(s), 0 warnings

See the attached file for a full test case (which boils down to the above
line).


-- 
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