Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/Compiler/Optimize/Optimizer.fs
Original file line number Diff line number Diff line change
Expand Up @@ -496,7 +496,7 @@ let rec IsPartialExprVal x =
| SizeValue (_, a) -> IsPartialExprVal a

let CheckInlineValueIsComplete (v: Val) res =
if v.ShouldInline && IsPartialExprVal res then
if v.ShouldInline && not v.IsMember && IsPartialExprVal res then
errorR(Error(FSComp.SR.optValueMarkedInlineButIncomplete(v.DisplayName), v.Range))
//System.Diagnostics.Debug.Assert(false, sprintf "Break for incomplete inline value %s" v.DisplayName)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,25 @@ open FSharp.Test.Compiler

module MemberDeclarations =

[<Fact>]
let ``Inline member with class-scope self identifier should compile`` () =
FSharp """
module Test

type TestClass1() as SomeSelfIdentifier =
member inline AnotherSelfIdentifier.test() = 5

type TestClass2() as self =
member inline self.test() = 5

type TestClass3() as self =
member inline _.test() = 5
"""
|> asLibrary
|> ignoreWarnings
|> compile
|> shouldSucceed

// Error tests

[<Theory; FileInlineData("E_byref_two_arguments_curried.fsx")>]
Expand Down
Loading