Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FAKE (4.7.2) breaks with #985

Closed
robertpi opened this issue Oct 21, 2015 · 6 comments
Closed

FAKE (4.7.2) breaks with #985

robertpi opened this issue Oct 21, 2015 · 6 comments

Comments

@robertpi
Copy link
Contributor

The following script breaks FAKE (4.7.2):
#r @"..\packages\FAKE\tools\FakeLib.dll"

open Fake
open RegistryHelper

let configure () =
    let dlls = seq { yield "" } 
    let tabName = sprintf "%s" ""
    for _ in dlls do
        setRegistryValue RegistryBaseKey.HKEYLocalMachine "" "" tabName

The output is:
C:\code\rfq-hub
>packages\FAKE\tools\FAKE.exe scripts\build.fsx

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

For help type #help;;

> [Loading C:\code\rfq-hub\scripts\build.fsx]



scripts\build.fsx(12,65): error FS0971: Undefined value 'tabName : string'

Very strange little bug, if you inline the dlls identifier, it works. If you use a list instead of a sequence it works. If you call some other function than setRegistryValue, it works.

@lulu-berlin
Copy link
Contributor

I was worried I might have broken something in the merged pull requests #976 and #980, but I haven't changed setRegistryValue.

So, this issue has nothing to do with the Registry and is only about disappearing identifier weirdness?

@robertpi
Copy link
Contributor Author

No, actually the repo can be reduced to:

open Fake
open RegistryHelper

let configure () =
    let dlls = seq { yield "" } 
    let tabName = sprintf "%s" ""
    for _ in dlls do
        Console.WriteLine(tabName)

Definitely not a FAKE problem, it's an issue in FSharp.Compiler.Services.

@lulu-berlin
Copy link
Contributor

Phew :)

I'm wondering: I don't understand FCS very deeply, but I saw that it can't find the binding of identifiers starting with an underscore (or an underscore, for that matter): fsprojects-archive/zzarchive-VisualFSharpPowerTools#1032 and fsharp/fsharp-compiler-docs#422

Is your issue related to that issue?

@robertpi
Copy link
Contributor Author

Don't think so, the bug occurs whether the for loop uses an underscore or not.

I think it's more like to relate to an optimization tries to convert strings to contants, but does take into account dynamically allocated strings. I say that, as if you change let tableTab to be a string constant, rather than the result of a sprintf, everything works ok.

@dsyme
Copy link
Collaborator

dsyme commented Dec 14, 2015

FCS 1.4.2.3 has been pushed with a fix for this integrated. I believe you should be able to update FAKE to use this.

@dsyme
Copy link
Collaborator

dsyme commented Apr 14, 2016

Closing old issue

@dsyme dsyme closed this as completed Apr 14, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants