-
Notifications
You must be signed in to change notification settings - Fork 797
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
Compiler failing with ArgumentException when calling data constructor with equality operator #823
Comments
FYI: English version's error message is here:
|
Another workaround: |
Interesting bug, I noticed the following, which may help pointing to the underlying issue, i.e. a (normal) named arguments error:
A different kind of
And your reported error happens for only two items in the tuple (at least of what I could find out), and if the last item starts with a variable as the LHS of the equal-operator:
When I tried some of the examples in VS2015, it crashed When trying to actually build (ignoring the crash) the output window showed three errors for
Result:
This was all tested with VS2015, F# 4.0. I think it is fair to assume that the compiler incorrectly chooses whether something is a named parameter or not, and when it considers it to be a named parameter and tries to treat it as one, it fails, because there is no such named parameter. But instead of giving an error of sorts, pointing to the ambiguity in your code, it crashes. |
Perhaps superfluous, but if you have a type:
Then, with the same code, you'd get a more expected error:
(which can be resolved in a variety of obvious ways). The same error appears when you add However: the issue with
and:
This crashes
To sum upTo reproduce:
|
Description:
fsc.exe and fsi.exe throw ArgumentException when calling data constructor with two equality operators.
Repro Steps:
Expected:
Actual:
Version: Language, compiler, library, platform version
VS2013, VS2015 (VS2012 works well)
Workaround: List any known workarounds
use paren.
The text was updated successfully, but these errors were encountered: