You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The problem I have experienced just now is when I am using System.Data.DataTable within a record type like so:
type checkResp = { resp : System.Data.DataTable }
The problem occurs when trying to use this record. It is unusable, intellisense reports that 'resp' is not a record field, and checkResp cannot be used within a type signature, further more hovering over the type name in Visual Studio shows that it is not processed by Intellisense. This leads us to believe there is an error in how the record type, but there is no error anywhere within the record, and strangely, it compiles in FSI fine!
I traced back the problem by trying to use DataTable() elsewhere in my code and seeing a popup saying that I need System.Xml.dll, so I added that reference and suddenly all errors went away. I believe this type of information should be surfaced at the time of defining the record type, as it turned into a 15 minute debug trip for a simple adding of a reference.
The text was updated successfully, but these errors were encountered:
You initially get an error due to missing ref to System.Data. Ok, fine.
When you add the System.Data reference, now you get cryptic squiggles on the type annotation, and no other obvious errors. What's the deal??
When you try a full compile, finally you see an error that indicates you need a reference to System.Xml
Note that the file/line for that error are dummy values, which is why you don't get squiggles. Also note that if you do go add the System.Xml reference, the compile succeeds but the resulting binary doesn't even reference System.Xml
This is a long-standing usability bug that's been kicking around internally since at least 2012. IIRC the compiler is a bit too aggressive about requiring transitive closure of referenced assemblies.
It works in FSI because System.Xml is in the list of assemblies referenced by default in interactive sessions.
The problem I have experienced just now is when I am using System.Data.DataTable within a record type like so:
type checkResp = { resp : System.Data.DataTable }
The problem occurs when trying to use this record. It is unusable, intellisense reports that 'resp' is not a record field, and checkResp cannot be used within a type signature, further more hovering over the type name in Visual Studio shows that it is not processed by Intellisense. This leads us to believe there is an error in how the record type, but there is no error anywhere within the record, and strangely, it compiles in FSI fine!
I traced back the problem by trying to use DataTable() elsewhere in my code and seeing a popup saying that I need System.Xml.dll, so I added that reference and suddenly all errors went away. I believe this type of information should be surfaced at the time of defining the record type, as it turned into a 15 minute debug trip for a simple adding of a reference.
The text was updated successfully, but these errors were encountered: