Skip to content

Fix linux build#5748

Merged
dsyme merged 2 commits intodotnet:masterfrom
cartermp:fix-linux
Oct 10, 2018
Merged

Fix linux build#5748
dsyme merged 2 commits intodotnet:masterfrom
cartermp:fix-linux

Conversation

@cartermp
Copy link
Copy Markdown
Contributor

@cartermp cartermp commented Oct 9, 2018

When compiling with .NET Core, these functions call methods with Span overloads, creating an ambiguity.

@cartermp cartermp changed the title Attempt to fix linux build Fix linux build Oct 9, 2018
@cartermp
Copy link
Copy Markdown
Contributor Author

cartermp commented Oct 9, 2018

cc @brettfo @KevinRansom

@KevinRansom
Copy link
Copy Markdown
Contributor

KevinRansom commented Oct 9, 2018

@TIHan

snip:

When compiling with .NET Core, these functions call methods with Span overloads, creating an ambiguity.

probably you can take a look at this.

@cartermp
Copy link
Copy Markdown
Contributor Author

cartermp commented Oct 9, 2018

So I think the issue is that:

  1. This script was using the curried form for method calls
  2. These methods now have an additional overload on .NET Core

Both combined caused the ambiguity and thus the compile error. Explicitly calling it as a method and specifying string fixes it.

@KevinRansom
Copy link
Copy Markdown
Contributor

@cartermp, Sweet, send a PR, nice work.

@cartermp
Copy link
Copy Markdown
Contributor Author

This is the PR 😄

@KevinRansom
Copy link
Copy Markdown
Contributor

Lol … I thought it was an issue … clearly when working at home, I should focus more.

@KevinRansom
Copy link
Copy Markdown
Contributor

@cartermp why did span cause ambiguity for these APIs? I don't understand why there was a failure.

@cartermp
Copy link
Copy Markdown
Contributor Author

cartermp commented Oct 10, 2018

Just standard pains with type inference + method overloads + F#-style parameter passing to .NET methods.

Prior to the .NET Core 2.1 builds, it was effectively like doing this:

type C() =
    static member Foo(str: string) = ()

let f1 x = C.Foo x

But now it's effectively like this:

type C() =
    static member Foo(str: string) = ()
    static member Foo(i : int) = ()

let f1 x = C.Foo x

Which produces:

A unique overload for method 'Foo' could not be determined based on type information prior to this program point. A type annotation may be needed. Candidates: static member C.Foo : i:int -> unit, static member C.Foo : str:string -> unit

And that was the cause of the build failure. Why the build only started using these updated APIs is unknown to me, but the fix is to just call the methods as methods.

What's perhaps interesting is that the type annotation alone did not fix it; I needed to pass it in with parentheses rather than as if it were F#-style function application.

@forki
Copy link
Copy Markdown
Contributor

forki commented Oct 10, 2018

can you please merge asap to get master green?

@dsyme dsyme merged commit 5d1843b into dotnet:master Oct 10, 2018
KevinRansom pushed a commit to KevinRansom/fsharp that referenced this pull request Oct 17, 2018
* Attempt to fix linux build

* Clean up
brettfo pushed a commit that referenced this pull request Oct 17, 2018
* Attempt to fix linux build

* Clean up
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

Successfully merging this pull request may close these issues.

5 participants