From ea55bc1f1764f0158b241230fba83d2cb2f05761 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 18 May 2026 11:23:04 +0000 Subject: [PATCH 1/2] Initial plan From 5f72fc7410ef4a6b4ce717658c903bfe9af6591a Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 18 May 2026 12:33:16 +0000 Subject: [PATCH 2/2] Fix FS1113 for inline instance members with class-scope self identifiers Agent-Logs-Url: https://github.com/dotnet/fsharp/sessions/02501657-eda7-4d68-a5d4-af85e644c220 Co-authored-by: T-Gro <46543583+T-Gro@users.noreply.github.com> --- src/Compiler/Optimize/Optimizer.fs | 2 +- .../MemberDeclarations/MemberDeclarations.fs | 19 +++++++++++++++++++ 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/src/Compiler/Optimize/Optimizer.fs b/src/Compiler/Optimize/Optimizer.fs index 3cbb574598c..f0a94c66516 100644 --- a/src/Compiler/Optimize/Optimizer.fs +++ b/src/Compiler/Optimize/Optimizer.fs @@ -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) diff --git a/tests/FSharp.Compiler.ComponentTests/Conformance/ObjectOrientedTypeDefinitions/ClassTypes/MemberDeclarations/MemberDeclarations.fs b/tests/FSharp.Compiler.ComponentTests/Conformance/ObjectOrientedTypeDefinitions/ClassTypes/MemberDeclarations/MemberDeclarations.fs index d69fb460957..03f225ee4d1 100644 --- a/tests/FSharp.Compiler.ComponentTests/Conformance/ObjectOrientedTypeDefinitions/ClassTypes/MemberDeclarations/MemberDeclarations.fs +++ b/tests/FSharp.Compiler.ComponentTests/Conformance/ObjectOrientedTypeDefinitions/ClassTypes/MemberDeclarations/MemberDeclarations.fs @@ -8,6 +8,25 @@ open FSharp.Test.Compiler module MemberDeclarations = + [] + 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 []