markrendle / Simple.Data

A light-weight, dynamic data access component for C# 4.0
MIT License
1.33k stars 303 forks source link

Does not compile in Mono #326

Open Earlz opened 10 years ago

Earlz commented 10 years ago

On mono I get an ambiguous call reference when compiling Release-mono

[earlz@EarlzLaptop projects]$ mono --version
Mono JIT compiler version 3.2.3 (tarball Sun Sep 22 20:38:43 UTC 2013)
Copyright (C) 2002-2012 Novell, Inc, Xamarin Inc and Contributors. www.mono-project.com
TLS:           __thread
SIGSEGV:       altstack
Notifications: epoll
Architecture:  amd64
Disabled:      none
Misc:          softdebug 
LLVM:          supported, not enabled.
GC:            sgen

Commands/ExecuteFunctionCommand.cs(42,26): error CS0121: The call is ambiguous between the following methods or properties: `Simple.Data.SimpleResultSet.SimpleResultSet(params System.Collections.Generic.IEnumerable<dynamic>[])' and `Simple.Data.SimpleResultSet.SimpleResultSet(System.Collections.Generic.IEnumerable<System.Collections.Generic.IEnumerable<dynamic>>)'
    SimpleResultSet.cs(25,16): (Location of the symbol related to previous error)
    SimpleResultSet.cs(29,16): (Location of the symbol related to previous error)
SimpleResultSet.cs(310,20): error CS0121: The call is ambiguous between the following methods or properties: `Simple.Data.SimpleResultSet.SimpleResultSet(params System.Collections.Generic.IEnumerable<dynamic>[])' and `Simple.Data.SimpleResultSet.SimpleResultSet(System.Collections.Generic.IEnumerable<System.Collections.Generic.IEnumerable<dynamic>>)'
    SimpleResultSet.cs(25,16): (Location of the symbol related to previous error)
    SimpleResultSet.cs(29,16): (Location of the symbol related to previous error)
Task "Csc" execution -- FAILED
jbonhag commented 9 years ago

I'm seeing the same thing on Mono 3.10.0. This seems to be an okay workaround:

var result = new SimpleResultSet((IEnumerable<dynamic>[])(resultSets.Select(resultSet => resultSet.Select(dict => new SimpleRecord(dict)))));

and

return new SimpleResultSet((IEnumerable<dynamic>[])(q));