Can somebody point me to working example of generated types F# TypeProvider? Ideally, based on F# sample pack "ProvidedTypes-*.fs" library.
I tried "GeneratedTypeProvider" from F# 3.0 Sample Pack but it doesn't work for me. I received "...'FSharpLib.T' does not contain a definition for 'F1' and no extension method 'F1' accepting a first argument of type 'FSharpLib.T' could be found (are you missing a using directive or an assembly reference?)" for C# project. I don't care much about C# project (ConsoleApplication1) but when I changed ConsoleApplication2 to run as console application that invokes T.F1 I received scary "Error in pass3 for type FSharpLib.Program, error: Error in GetMethodRefAsMethodDefIdx for mref = "F1", error: Exception of type 'Microsoft.FSharp.Compiler.AbstractIL.ILBinaryWriter+MethodDefNotFound' was thrown." And honestly, it's suspicious that source code out of sync with http://apollo13cn.blogspot.com/2013/01/generated-type-provider-and-code.html
I also looked at http://code.google.com/p/froto/source/browse/Gen/ProtoTypeProvider.fs. I didn't compile/ran the project but it doesn't use Sample Pack which is certainly sub-optimal.
Not sure about "Playground" project by colinbull on GitHub because it seems just to copy types from other assembly.
In general Tests project in sample pack contains tests for both erased and generated type providers. However when I run tests I saw the same error that you have - seems that 'provided types' API was partially broken recently - now fixed (at least for the tests project, have not tried GeneratedTypeProvider sample)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With