https://bugzilla.novell.com/show_bug.cgi?id=389624
Summary: gmcs error CS0029: Cannot implicitly convert type `T' to
`T'
Product: Mono: Compilers
Version: 1.9.0
Platform: Other
OS/Version: Other
Status: NEW
Severity: Normal
Priority: P5 - None
Component: C#
AssignedTo: [email protected]
ReportedBy: [EMAIL PROTECTED]
QAContact: [email protected]
Found By: ---
The attached code does not compile. Note, this may be a duplicate of bug:
https://bugzilla.novell.com/show_bug.cgi?id=325069
class Test {
delegate void Handler();
static T Foo<T>() where T : new() {
T result = default(T);
Bar(delegate() {
// ACTUAL: bug-002.cs(9,13): error CS0029: Cannot implicitly
convert type `T' to `T'
result = new T();
});
return result;
}
static void Bar(Handler h) {
h();
}
static void Main(string[] args) {
Foo<object>();
}
}
---
frog:mono-tests petee$ gmcs bug-002.cs
bug-002.cs(9,13): error CS0029: Cannot implicitly convert type `T' to `T'
bug-002.cs(9,13): The generic parameter `T' of
`Test.<>c__CompilerGenerated0<T>' cannot be converted to the generic parameter
`T' of `Test.Foo<T>()' (in the previous error)
Compilation failed: 1 error(s), 0 warnings
--
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.
_______________________________________________
mono-bugs maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-bugs