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

op_Implicit doesn't work with the pipe operator #18160

Open
KevinRansom opened this issue Dec 18, 2024 · 1 comment
Open

op_Implicit doesn't work with the pipe operator #18160

KevinRansom opened this issue Dec 18, 2024 · 1 comment

Comments

@KevinRansom
Copy link
Member

Image

type CompilerHelper = 
    {
        // Define the properties of CompilerHelper
        Name: string
        Code: string
    }

    // Define the implicit conversion operator
    static member op_Implicit(helper: CompilerHelper) : CompilationUnit =
        {
            UnitName = helper.Name
            SourceCode = helper.Code
        }

and CompilationUnit = 
    {
        // Define the properties of CompilationUnit
        UnitName: string
        SourceCode: string
    }

// Example usage

let verifyCompilation (compilation: CompilationUnit) = printfn "${compilation}"

let helper = { Name = "Example"; Code = "let x = 42" }
let b = verifyCompilation helper
let c = helper |> verifyCompletion
@vzarytovskii
Copy link
Member

Yeah, this is by design, if it isn’t mentioned in the implicit conversions rfc, it should be. If the desire is to support it, separate suggestion should be raised.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: New
Development

No branches or pull requests

2 participants