-
Notifications
You must be signed in to change notification settings - Fork 802
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
Mixing named arguments + callback style and getter should not compile #17935
Comments
Changed name, there is no "DU" involved in this case. The codegen is definitely wrong. Out of the 4 options here, only alert3 and alert4 are correct, the others are a bug/missing error: type MyFunc = string * string option -> unit
type LabeledProperty =
abstract member alert: title:string * message:string option -> unit with get,set
abstract member alert2: string * string option -> unit with get,set
abstract member alert3: (string * string option -> unit) with get,set
abstract member alert4: MyFunc with get,set |
It seems that it you use type LabeledProperty =
abstract member Item: title:string * message:string option -> unit with get,set [CompilationMapping(SourceConstructFlags.Module)]
public static class @_
{
[Serializable]
[CompilationMapping(SourceConstructFlags.ObjectType)]
public interface LabeledProperty
{
override Unit this[string title, FSharpOption<string> message] { get; set; }
}
} See sharplab |
I think the code below should not compile.
Repro steps
Provide the steps required to reproduce the problem:
Looking at the C# output it gives the following result which looks incomplete.
Expected behavior
F# compiler should fails the compilation ?
Provide any related information (optional):
The text was updated successfully, but these errors were encountered: