I am trying to have Name return the value of item.name where item is an instance of a C# class.
the fs file contains
namespace PatternMatch
type PatternMatch() =
member this.X = "F#"
namespace Items_
the fsx file contains
#load "PatternMatch.fs"
open PatternMatch
open Items_
type item = Item
let Name item = item.name //this line throws the error
let rec sentence s item = function
| s when s="Action" -> ""
| s when s="Client" -> ""
| s when s="Classifier" -> ""
| s when s="Container" -> ""
| s when s="ControlFlow" -> ""
| s when s="Gaurd" -> ""
| s when s="Name" -> Name item
| s when s="ObjectFlow" -> ""
| s when s="Source" -> ""
| _ -> ""
let Name item = item.name throws the error.
Items_ is a C# namespace and Item is a C# class within.
The entire error is:
Lookup on object of indeterminate type based on information prior to this program point. A type annotation may be needed prior to this program point to constrain the type of the object. This may allow the lookup to be resolved. C:\Users\jzbedocs\Local Files\Visual Studio 2010\Projects\addin\trunk\PatternMatch\Script.fsx 11 17 PatternMatch
itemparam ofNamefunction. - Eugene Fotintype item = Itemcreates a type alias. Inlet Name (item: Item) = item.Nameparamitemhas a type annotation ofItem. - Eugene Fotin