When using the following code in an fsx file I get the error The type seq<'a> is not compatible with the type Collections.Generic.IEnumerable<'a>.
module ReadOnly =
let private asList<'a> (en:System.Collections.Generic.IEnumerable<'a>) : System.Collections.Generic.IList<'a> =
new System.Collections.Generic.List<'a>(en) :> System.Collections.Generic.IList<'a>
let private asReadOnly<'a> (en:System.Collections.Generic.IEnumerable<'a>) =
new System.Collections.ObjectModel.ReadOnlyCollection<'a>(asList(en))
let ofSeq<'a> (ss: 'a seq) = asReadOnly<'a>(ss) // <-- ERROR IS HERE ON ARGUMENT 'ss'
When using the same code in a netcoreapp2.1 console application all is fine.
My paket.dependencies contains the following:
source https://www.nuget.org/api/v2
nuget NETStandard.Library
nuget canopy
and I load the following:
#r "packages/NETStandard.Library/build/netstandard2.0/ref/netstandard.dll"
#r "packages/Selenium.WebDriver/lib/netstandard2.0/WebDriver.dll"
#r "packages/canopy/lib/netstandard2.0/canopy.dll"
Note: I included netstandard2.0 as I was having issues with not finding
Object
Object? - AMieresThe type 'Object' is required here and is unavailable. You must add a reference to assembly 'netstandard, Version=2.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'.- Devon BurrissObjectissue? - AMieres