Skip to content

FCS loads #load files in the wrong order #587

Closed
@matthid

Description

@matthid

See fsprojects/FAKE#1263

Repro steps

  1. git clone https://github.com/matthid/fcs_bug_fake_1263.git
  2. ./build.sh

For details see the linked issue.
But its reproduced with

1.fsx

#load "2.fsx"
#load "3.fsx"
printfn "HELLO FROM 1"

2.fsx

#load "4.fsx"
printfn "HELLO FROM 2 %A" ``4``.T

3.fsx

#load "4.fsx"
printfn "HELLO FROM 3"

and

4.fsx

printfn "HELLO FROM 4"
type T = T

and executing 1.fsx with FSharp.Compiler.Service via EvalScriptNonThrowing.

Expected behavior

Like fsi.exe

HELLO FROM 4
HELLO FROM 2 T
HELLO FROM 4
HELLO FROM 3
HELLO FROM 1

or

HELLO FROM 4
HELLO FROM 2 T
HELLO FROM 3
HELLO FROM 1

Actual behavior

Starting Target: RunRepro (==> BuildRepro)
bin/repro/Repro.exe

F# Interactive for F# 4.0 (private)
Freely distributed under the Apache 2.0 Open Source License

For help type #help;;

> [Loading C:\PROJ\FSharp.Compiler.Service_error_in_loadedScript\2.fsx
 Loading C:\PROJ\FSharp.Compiler.Service_error_in_loadedScript\4.fsx
 Loading C:\PROJ\FSharp.Compiler.Service_error_in_loadedScript\3.fsx
 Loading C:\PROJ\FSharp.Compiler.Service_error_in_loadedScript\1.fsx]
Stopped due to error
(Choice2Of2
   System.Exception: Operation could not be completed due to earlier error,
 [|C:\PROJ\FSharp.Compiler.Service_error_in_loadedScript\2.fsx (3,27)-(3,32) typecheck error The namespace or module '4' is not defined|])

Known workarounds

No known workaround.

Related information

  • FSharp.Compiler.Service 3.0
  • Windows 10
  • VS 2015

fsi.exe 1.fsx works as expected.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions