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

unique overload for CircularBuffer method 'Enqueue' could not be determined #123

Closed
jackfoxy opened this issue Jul 7, 2018 · 6 comments
Closed

Comments

@jackfoxy
Copy link
Contributor

jackfoxy commented Jul 7, 2018

Description

type CircularBuffer<'T> =
  member Enqueue : value:'T [] -> unit
  member Enqueue : value:'T -> unit

Second overload works, but attempting to write code for the first overload results in error

Repro steps

See commented tests in CircularBufferTests.fs

@vasily-kirichenko
Copy link

VS 15.7.4

Everything compiles OK and the tests pass (build.cmd).
Also, everything compiles OK from within VS.
But the editor does not work on the test project:

image

Error | FS3160 | Problem reading assembly 'C:\git\FSharpx.Collections\src\FSharpx.Collections\bin\Debug\net45\FSharpx.Collections.dll': Build was not evaluated, expected the results to be ready after 'Eval' (GetCheckResultsAndImplementationsForProject, data = ("FinalizeTypeCheck", [|Id 1007; Id 1008; Id 1009; Id 1010; Id 1011|], Id 1013, false, None)). | FSharpx.Collections.Tests | C:\git\FSharpx.Collections\tests\FSharpx.Collections.Tests\CircularBufferTests.fs | 1 | Active

@vasily-kirichenko
Copy link

Rider 2018.2 works totally OK:

image

@jackfoxy
Copy link
Contributor Author

jackfoxy commented Jul 8, 2018

As discussed on Slack, the problem is revealed in the tests that are commented (because they do not build).

@jackfoxy
Copy link
Contributor Author

jackfoxy commented Jul 8, 2018

With @vasily-kirichenko help on the https://functionalprogramming.slack.com/messages/C045LHLTH/ channel we figured out the problem. I'm sure this is an old regression that the compiler no longer takes into account overload ordering, so it cannot tell the difference between 'T [] and 'T.

@jackfoxy
Copy link
Contributor Author

jackfoxy commented Jul 8, 2018

Work around is to specify type parameter, e.g. let circularBuffer = CircularBuffer<int> 5

@jackfoxy
Copy link
Contributor Author

jackfoxy commented Jul 8, 2018

Not a bug in compiler. Old 2013 was exploiting a prior bug in compiler which has been fixed.

@jackfoxy jackfoxy closed this as completed Jul 8, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants