Skip to content

Instantly share code, notes, and snippets.

@troykershaw
Created September 6, 2013 05:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save troykershaw/6459750 to your computer and use it in GitHub Desktop.
Save troykershaw/6459750 to your computer and use it in GitHub Desktop.
A reproduction of the XML Type Provider issue raised on Stack Overflow (see url at end). Essentially, DomainTypes appear in IntelliSense, but the compiler gives an **Error FS0039: The type 'Ul' is not defined (FS0039)** error, and the same thing for 'Li'. http://stackoverflow.com/questions/18453911/type-provider-not-recognized-when-building-project
module XmlTypeProviderIssue
open System
open FSharp.Data
type Html = XmlProvider<"""
<div>
<span>
<ul>
<li/>
</ul>
</span>
</div>""">
let html = Html.GetSample()
// Div is defined
let divWorks (div:Html.DomainTypes.Div) = ()
// Span is defined
let spanWorks (span:Html.DomainTypes.Span) = ()
// Ul is not
let ulBreaks (ul:Html.DomainTypes.Ul) = ()
// and neither is Li
let liBreaks (li:Html.DomainTypes.Li) = ()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment