Skip to content

No indentation warning is given when a hash directive is used inside a nested module #3841

Description

@auduchinok

Consider File.fsx:

// implicit top-level module File

let x = 42

module Nested =
    // File.Nested.foo
    let foo = 123

#load "OtherFile.fsx"

    // Looks like File.Nested.bar, but is actually File.bar due to the use of #load.
    // Unlike conditional hash directives it terminates declarations/expressions,
    // which may be not very obvious to users.

    // I suppose, being in the outer module it should have the same indentation
    // as x and Nested module, however no indentation warning/error is given.

    // Looks like it also adds another context in the LexFilter,
    // which in turn makes next expressions indented incorrectly.
    let bar = foo // foo is unresolved

let y = x // incorrect indentation

Metadata

Metadata

Assignees

Labels

AI-thinks-issue-fixedArea-FSIBugImpact-Low(Internal MS Team use only) Describes an issue with limited impact on existing code.

Type

Projects

Status
In Progress

Relationships

None yet

Development

No branches or pull requests

Issue actions