1
我創建了說一個新的F#庫中的以下表述:錯誤,同時創造一個F#庫
module Module1
let x = 2 + 2
當試圖運行它,我得到一個錯誤
Unexpected start of structured construct in definition. Expected '=' or other token.
我創建了說一個新的F#庫中的以下表述:錯誤,同時創造一個F#庫
module Module1
let x = 2 + 2
當試圖運行它,我得到一個錯誤
Unexpected start of structured construct in definition. Expected '=' or other token.
當你說「運行「,你的意思是全選 - > ALT + ENTER發送給FSI?如果是這樣,我認爲這是你的問題。 FSI不處理文件級模塊聲明。當您將其發送到FSI時,您需要選擇module Module1
或將其更改爲模塊表達式:
module Module1 =
let x = 2 + 2