Module values in F# don't get initialized. Why?

Viewed 1596

I got a strange behavior when I used F#. When I use let binding in a module, and if the value is created from a constructor, then it's uninitialized when used outside. (I used it from C# using ModuleName.s2 or ModuleName.f())

//in a module
let s1 = "1" //normal
let s2 = new String('i', 5) //null

let f () =
    s2.Equals("something") //Exception

Is this a normal behavior? Thanks in advance.

EDIT: For the purpose of debugging, I choose to compile it as an executable. This may be the problem as other people pointed out.

2 Answers
Related