Skip to content

Emit a warning when referencing console applications exe's without a main #602

Open
@tldrlol

Description

@tldrlol

Create a solution with two Console Application projects:

ConsoleApplication1\Program.fs:

module SharedValue
let hello = "Hello" |> id

ConsoleApplication2\Program.fs (references ConsoleApplication1)

match SharedValue.hello with
| null -> printfn "SharedValue.hello is null!"
| _    -> printfn "all good"

Expected output: all good
Actual output: SharedValue.hello is null!

needless to say, getting a null value from an F# project is quite surprising.

Changing the type of ConsoleApplication1 to a Library fixes this.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Area-Diagnosticsmistakes and possible improvements to diagnosticsBugImpact-Medium(Internal MS Team use only) Describes an issue with moderate impact on existing code.Theme-Simple-F#A cross-community initiative called "Simple F#", keeping people in the sweet spot of the language.

    Type

    Projects

    Status

    In Progress

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions