F# and Visual Studio: where IntelliSense fools you.
F# seems to have two way to compile the language. For example, the following code snippet causes an error where "x.RootDirectory" cannot be determined but If you check with intellisense in VS, you should see that all variable's types are already recognized!??
open System.IO open System.Collections.Generic type A() as me = let drives = new List<DriveInfo>() let x = me.SelectedDrive let y = x.RootDirectory // error here member this.SelectedDrive with get() = drives.[0]
So why it cannot be compiled? According to the answer of my question on StackOverflow.com, this.SelectedDrive is not yet recognized by the compiler so it causes error. But this is contrary to the IntelliSense where it reports the type correctly! Apparently, the parser used in Visual Studio's Intellisense is different (and smarter?) than the one used in the compiler itself... funny but the bottom line is don't trust IntelliSense for F# ^^;
















