When you use const
in .NET, all references to it are replaced by its value at the time of compilation.
It sounds great until you understand that it is not limited to the assembly where the constant is defined. Other assemblies that reference it will also copy the constant value at compile time.
:
F #
module ConstTest
let [<Literal>] ConstInt = 1
let NotConstInt = ConstInt
[<EntryPoint>]
let main argv =
printfn "%A %A" ConstTest.ConstInt ConstTest.NotConstInt
0
1 1
- .
module ConstTest
let [<Literal>] ConstInt = 2
let NotConstInt = ConstInt
( !), dll . 1 2
. , .
, . .