From cac52be980c2e9df286dc7d10dd2909296ed03f4 Mon Sep 17 00:00:00 2001 From: KevinRansom Date: Mon, 8 Jul 2024 20:28:09 -0700 Subject: [PATCH 1/2] temp --- docs/release-notes/.FSharp.Compiler.Service/9.0.100.md | 1 + src/Compiler/Optimize/Optimizer.fs | 5 ++++- .../RecursiveSafetyAnalysis/RecursiveSafetyAnalysis.fs | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/docs/release-notes/.FSharp.Compiler.Service/9.0.100.md b/docs/release-notes/.FSharp.Compiler.Service/9.0.100.md index bbe39d04166..d14c8f36ee7 100644 --- a/docs/release-notes/.FSharp.Compiler.Service/9.0.100.md +++ b/docs/release-notes/.FSharp.Compiler.Service/9.0.100.md @@ -1,4 +1,5 @@ ### Fixed +* Compiler hangs wne compiling inline recursive invocation ([Issue #17376](https://github.com/dotnet/fsharp/issues/17376), [PR #17394](https://github.com/dotnet/fsharp/pull/17394)) ### Added diff --git a/src/Compiler/Optimize/Optimizer.fs b/src/Compiler/Optimize/Optimizer.fs index 52b1dccc558..b2f5f654ce2 100644 --- a/src/Compiler/Optimize/Optimizer.fs +++ b/src/Compiler/Optimize/Optimizer.fs @@ -3137,9 +3137,12 @@ and OptimizeVal cenv env expr (v: ValRef, m) = | None -> if v.ShouldInline then - warning(Error(FSComp.SR.optFailedToInlineValue(v.DisplayName), m)) + match valInfoForVal.ValExprInfo with + | UnknownValue -> error(Error(FSComp.SR.optFailedToInlineValue(v.DisplayName), m)) + | _ -> warning(Error(FSComp.SR.optFailedToInlineValue(v.DisplayName), m)) if v.InlineIfLambda then warning(Error(FSComp.SR.optFailedToInlineSuggestedValue(v.DisplayName), m)) + expr, (AddValEqualityInfo g m v { Info=valInfoForVal.ValExprInfo HasEffect=false diff --git a/tests/FSharp.Compiler.ComponentTests/Conformance/InferenceProcedures/RecursiveSafetyAnalysis/RecursiveSafetyAnalysis.fs b/tests/FSharp.Compiler.ComponentTests/Conformance/InferenceProcedures/RecursiveSafetyAnalysis/RecursiveSafetyAnalysis.fs index 9b9beecfdb0..52bf8601869 100644 --- a/tests/FSharp.Compiler.ComponentTests/Conformance/InferenceProcedures/RecursiveSafetyAnalysis/RecursiveSafetyAnalysis.fs +++ b/tests/FSharp.Compiler.ComponentTests/Conformance/InferenceProcedures/RecursiveSafetyAnalysis/RecursiveSafetyAnalysis.fs @@ -49,7 +49,7 @@ module RecursiveSafetyAnalysis = (Error 1114, Line 8, Col 15, Line 8, Col 25, "The value 'E_RecursiveInline.test' was marked inline but was not bound in the optimization environment") (Error 1113, Line 7, Col 16, Line 7, Col 20, "The value 'test' was marked inline but its implementation makes use of an internal or private function which is not sufficiently accessible") (Warning 1116, Line 8, Col 15, Line 8, Col 25, "A value marked as 'inline' has an unexpected value") - (Warning 1118, Line 8, Col 15, Line 8, Col 25, "Failed to inline the value 'test' marked 'inline', perhaps because a recursive value was marked 'inline'") + (Error 1118, Line 8, Col 15, Line 8, Col 25, "Failed to inline the value 'test' marked 'inline', perhaps because a recursive value was marked 'inline'") ] // SOURCE=E_TypeDeclaration01.fs SCFLAGS="--langversion:5.0 --test:ErrorRanges" COMPILE_ONLY=1 # E_TypeDeclaration01.fs From 13a1816200996d0129564a6f121abe7f3d2c6a0a Mon Sep 17 00:00:00 2001 From: "Kevin Ransom (msft)" Date: Tue, 9 Jul 2024 01:07:26 -0700 Subject: [PATCH 2/2] Update 9.0.100.md --- docs/release-notes/.FSharp.Compiler.Service/9.0.100.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/release-notes/.FSharp.Compiler.Service/9.0.100.md b/docs/release-notes/.FSharp.Compiler.Service/9.0.100.md index d14c8f36ee7..7282b2d0b50 100644 --- a/docs/release-notes/.FSharp.Compiler.Service/9.0.100.md +++ b/docs/release-notes/.FSharp.Compiler.Service/9.0.100.md @@ -1,5 +1,5 @@ ### Fixed -* Compiler hangs wne compiling inline recursive invocation ([Issue #17376](https://github.com/dotnet/fsharp/issues/17376), [PR #17394](https://github.com/dotnet/fsharp/pull/17394)) +* Compiler hangs when compiling inline recursive invocation ([Issue #17376](https://github.com/dotnet/fsharp/issues/17376), [PR #17394](https://github.com/dotnet/fsharp/pull/17394)) ### Added