Casey Marshall | 1 Feb 2008 01:58

PATCH: mcs: better type matching for anonymous methods

Hi. The attached patch to mcs seems to fix bug 357047 (which I also
filed). The issue is that the compiler can't tell that:

  enumerable.Average(o => op on o that returns a double);

or

  enumerable.Average(delegate(T o) { return (op on o that returns a
double); });

Means Average<T>(IEnumerable<T>,Func<T,double>) or
Average<T>(IEnumerable<T>,Func<T,double?>). This means that you get an
error that the method call is ambiguous.

The patch works by inferring the return type of the argument, then
testing if that return value is an exact match for the return value of
the Func parameter. If so, it breaks ties with the exact match.

This is the first hacking I've done on mcs, so I'm not sure about how
correct this is. Comments are welcome.

Thanks.

Attachment (PR-357047.patch): text/x-patch, 1286 bytes
_______________________________________________
Mono-devel-list mailing list
Mono-devel-list <at> lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list
Juraj Skripsky | 1 Feb 2008 10:32
Picon

[PATCH] CodeGenerator/CodeDom classes

Hi monkeys,

Could somebody please review my patch for the System.CodeDom classes?

This is the fourth time I'm posting this and nobody provided any
feedback so far. I'm sending this via my gmail account now, in case my
previous mails did not reach the list subscribers (they _did_ reach the
list itself).

I've created a enhancement bug which contains the code:
https://bugzilla.novell.com/show_bug.cgi?id=356657

ChangeLog entries are included, all unit tests pass.
Please review (or at least comment...)

- Juraj
Gert Driesen | 1 Feb 2008 10:36
Picon
Favicon

Re: [PATCH] CodeGenerator/CodeDom classes

Hi Juraj,

These changes look fine to me, but I'm not sure if I'm allowed to give you the "blessing" on this one.

Gert

----- Original Message ----- 
From: "Juraj Skripsky" <juraj.skripsky <at> gmail.com>
To: <mono-devel-list <at> lists.ximian.com>
Cc: "Miguel de Icaza" <miguel <at> novell.com>
Sent: Friday, February 01, 2008 10:32 AM
Subject: [Mono-dev] [PATCH] CodeGenerator/CodeDom classes

> Hi monkeys,
> 
> Could somebody please review my patch for the System.CodeDom classes?
> 
> This is the fourth time I'm posting this and nobody provided any
> feedback so far. I'm sending this via my gmail account now, in case my
> previous mails did not reach the list subscribers (they _did_ reach the
> list itself).
> 
> I've created a enhancement bug which contains the code:
> https://bugzilla.novell.com/show_bug.cgi?id=356657
> 
> ChangeLog entries are included, all unit tests pass.
> Please review (or at least comment...)
> 
> - Juraj
> 
> _______________________________________________
> Mono-devel-list mailing list
> Mono-devel-list <at> lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-devel-list
>
Hubert FONGARNAND | 1 Feb 2008 12:08
Picon

Performance problem with System.Data

I think i've catched a huge perf. problem with System.Data

https://bugzilla.novell.com/show_bug.cgi?id=357947
_________________________________________________
Ce message et les eventuels documents joints peuvent contenir des informations confidentielles. Au cas ou il ne vous serait pas destine, nous vous remercions de bien vouloir le supprimer et en aviser immediatement l'expediteur. Toute utilisation de ce message non conforme a sa destination, toute diffusion ou publication, totale ou partielle et quel qu'en soit le moyen est formellement interdite. Les communications sur internet n'etant pas securisees, l'integrite de ce message n'est pas assuree et la societe emettrice ne peut etre tenue pour responsable de son contenu.
_______________________________________________
Mono-devel-list mailing list
Mono-devel-list <at> lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list
Alistair Leslie-Hughes | 1 Feb 2008 12:18
Picon
Favicon

Using IDispatch as an Argument in Invoke.

Hi,
    I've embbed mono into an application that Im working on.  The function 
in my Assembly has a IDispatch pointer as its first argument, how can I pass 
this value throught to my mono class?

If it cannot be done, is there any timeframe?

Best Regards
 Alistair Leslie-Hughes 
Stefan Noack | 1 Feb 2008 15:30
Gravatar

System.Collections.Generic.Dictionary`2 bug?

Hi,

I got he following problem: When i change the values of a Dictionary`2
enumerating the keys i get an exception. for example:

Dictionary<string,int> test = new Dictionary<string,int> ();

test.Add ("foo", 2);
test.Add ("bar", 3);

foreach (string key in test.Keys) {
	test [key] = 5;
}

throws:

System.InvalidOperationException : out of sync
at System.Collections.Generic.Dictionary`2
+Enumerator[System.String,System.Int32].VerifyState () [0x00000]
at System.Collections.Generic.Dictionary`2
+Enumerator[System.String,System.Int32].MoveNext () [0x00000]
at System.Collections.Generic.Dictionary`2+KeyCollection
+Enumerator[System.String,System.Int32].MoveNext () [0x00000]

It looks like the KeyCollection enumerator uses the Enumerator of the
Dictionary which might invalidate when i change the values, but is this
intended? 

MSDN says:

«The foreach statement is a wrapper around the enumerator, which allows
only reading from the collection, not writing to it.»

So do i have to understand this in the way that i am also not allowed to
change the values ehen enumerating the keys?

If it is a bug, please tll me i will then try to fix it, if not i will
change my code to use a copy of the key list or something.

--
Stefan Noack

_______________________________________________
Mono-devel-list mailing list
Mono-devel-list <at> lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list
Andrew Koryavchenko | 1 Feb 2008 15:39
Picon
Favicon

Re: System.Collections.Generic.Dictionary`2 bug?

Hello

So do i have to understand this in the way that i am also not allowed to
change the values ehen enumerating the keys?

Yes
_______________________________________________
Mono-devel-list mailing list
Mono-devel-list <at> lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list
Jb Evain | 1 Feb 2008 15:40
Picon
Favicon

Re: System.Collections.Generic.Dictionary`2 bug?

Hey,

On 2/1/08, Stefan Noack <noackstefan <at> googlemail.com> wrote:
> So do i have to understand this in the way that i am also not allowed to
> change the values ehen enumerating the keys?

Exactly.

--

-- 
Jb Evain  <jb <at> nurv.fr>
Jae Stutzman | 1 Feb 2008 15:54
Picon

Mono 1.2.6 on Maemo OS2008 help

I saw in some of the logs that this is currently being worked on by a
few folks. Does anyone know the status of this? I'm thinking I may
have to build it myself, but I'd rather not :)

Thanks,

Jae
Stefan Noack | 1 Feb 2008 16:27
Gravatar

Re: System.Collections.Generic.Dictionary`2 bug?

Thanks :)

I just use the List<T>(IEnumerable<T>) constructor and enumerate the
list now.

On Fri, 2008-02-01 at 15:40 +0100, Jb Evain wrote:
> Hey,
> 
> On 2/1/08, Stefan Noack <noackstefan <at> googlemail.com> wrote:
> > So do i have to understand this in the way that i am also not allowed to
> > change the values ehen enumerating the keys?
> 
> Exactly.
> 
--

-- 
Check out my open source .NET physics library project at
http://liblamp.sourceforge.net

Gmane