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

Regression: inline data for method (related to witness passing PR) #9449

Closed
dsyme opened this issue Jun 15, 2020 · 1 comment
Closed

Regression: inline data for method (related to witness passing PR) #9449

dsyme opened this issue Jun 15, 2020 · 1 comment

Comments

@dsyme
Copy link
Contributor

dsyme commented Jun 15, 2020

I think the changes for #6345 have caused a regression where inlining data is no longer being stored for some kind of code involving SRTP calls. I can't yet determine the exact issue but here is a repro, it is related to the failures in #6811 since integrating with master

lib.fs:

module T 

let inline RequireM< ^Witnesses, ^T when (^Witnesses or ^T): (static member M : ^TaskLike -> string) > () : string = 
    ((^Witnesses or ^T): (static member M : ^T-> string) (Unchecked.defaultof<_>))

type C() = class end

[<Sealed>] 
type Witnesses() =

    static member M (x: C) : string = failwith ""

    static member M (x: int64) : string = failwith ""


type StaticMethods() = 

    static member inline M< ^T when (Witnesses or  ^T): (static member M: ^T-> string)>  (task: ^T) : string =

        RequireM< Witnesses, ^T> ()

app.fs:

open T
let tbind(t:C) =
        T.StaticMethods.M(t)

Run

artifacts\bin\fsc\Debug\net472\fsc --optimize- -a --langversion:preview lib.fs
artifacts\bin\fsc\Debug\net472\fsc.exe -r:lib.dll --optimize- --langversion:preview app.fs

Expected: compilation succeeds

Actual: compilation fails:

t.fs(20,26): error FS1113: The value 'M' was marked inline but its implementation makes use of an internal or private function which is not sufficiently accessible

a.fs(3,9): warning FS1116: A value marked as 'inline' has an unexpected value

a.fs(3,9): error FS1118: Failed to inline the value 'M' marked 'inline', perhaps because a recursive value was marked 'inline'
@dsyme
Copy link
Contributor Author

dsyme commented Jun 17, 2020

Fixed

@dsyme dsyme closed this as completed Jun 17, 2020
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

No branches or pull requests

1 participant