I created a new F# library with say the following expressions:
module Module1
let x = 2 + 2
When trying to run this, I get an error
Unexpected start of structured construct in definition. Expected '=' or other token.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
When you say “run”, do you mean select all -> ALT + ENTER to send to FSI? If so, I think that is your issue. FSI doesn’t handle file-level module declarations. You need to either not select
module Module1when you send it to FSI, or change it to a module expression: