Debug: FS2014 duplicate `<f>__debug@N` in method table for an inline call inside a resumable CE whose `Run` has caller-info parameters (regression in 11.0.100-rc.2)
Maintainer thường phản hồi trong vòng 3 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 48/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- fsharp
- Lĩnh vực
- build-system, compilers
Hướng nghiên cứu
Start by building the supplied Lib.fs repro in Debug with SDK 11.0.100-rc.2, then compare the generated state-machine and closure output for the resumable and dynamic paths. The issue links #20469 and reports that both branches emit a specialized inline call under the same debug method name; inspect that lowering path and confirm the duplicate method entry is gone while the listed variations still behave as described.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Repro
Lib.fs, in a net10.0 library, built with dotnet build -c Debug on SDK 11.0.100-rc.2.26504.105:
module Lib
#nowarn "3513"
open System.Runtime.CompilerServices
open System.Runtime.InteropServices
open Microsoft.FSharp.Core.CompilerServices
open Microsoft.FSharp.Core.CompilerServices.StateMachineHelpers
[<Struct; NoEquality; NoComparison>]
type D<'T> = { mutable Result: 'T }
type B() =
member inline _.Delay([<InlineIfLambda>] f: unit -> ResumableCode<'D, 'T>) =
ResumableCode<'D, 'T>(fun sm -> (f ()).Invoke(&sm))
member inline _.Return(v: 'T) = ResumableCode<D<'T>, 'T>(fun sm -> sm.Data.Result <- v; true)
member inline _.Run(code: ResumableCode<D<'T>, 'T>,
[<CallerLineNumber; Optional; DefaultParameterValue(0)>] line: int) : 'T =
if __useResumableCode then
__stateMachine<D<'T>, 'T>
(MoveNextMethodImpl<D<'T>>(fun sm -> __resumeAt sm.ResumptionPoint; code.Invoke(&sm) |> ignore))
(SetStateMachineMethodImpl<D<'T>>(fun _ _ -> ()))
(AfterCode<D<'T>, 'T>(fun sm -> sm.Data.Result))
else
let mutable sm = ResumableStateMachine<D<'T>>()
code.Invoke(&sm) |> ignore
sm.Data.Result
let b = B()
let f () : int = b { return [ 3 ] |> List.sum }
Result
error FS2014: A problem occurred writing the binary 'obj/Debug/net10.0/refint/repro.dll': Error in pass2 for type Lib, error: duplicate entry '<sum>__debug@28' in method table
Narrowing
| Variation | rc.2 Debug |
|---|---|
| As above | FS2014 |
-p:ProduceReferenceAssembly=false |
FS2014 (on the main dll instead of refint) |
Run without the [<CallerLineNumber>] parameter |
builds |
Body without an inline call (b { return 3 }) |
builds |
task { return [ 3 ] |> List.sum } |
builds |
Non-resumable builder with the same caller-info Run |
builds |
| Release | builds |
Same repro on SDK 11.0.100-rc.1.26425.128 (Debug) |
builds |
In a builder of the same shape (no inline call in the body), rc.2 Debug now emits the state-machine struct and the dynamic-path closures for one CE, where rc.1 Debug emitted only the closure. So both branches of if __useResumableCode seem to survive, and an inline call in the body is specialized once per branch, under the same <f>__debug@<line> name. This looks related to #20469 ("Preserve resumable state-machine lowering in Debug"), merged between rc.1 and rc.2.
Found in https://github.com/ekonbenefits/FSharp.Interop.Dlr (its dlr { } builder has this Run shape), where any dlr { } that calls an inline function fails to build in Debug on rc.2: ekonbenefits/FSharp.Interop.Dlr#235.
- Ngôn ngữ chính
- F#
- Star
- 4.3k
- Fork
- 882
- Merge trung bình
- 4 ngày 14 giờ
- Pull request đã merge (30 ngày)
- 138
Chuẩn bị môi trường
Khởi chạy dev container của dự án ngay trên trình duyệt, bằng tài khoản GitHub của bạn.
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của dotnet/fsharp
-
Needs-Triage
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 95/100
Maintainer thường phản hồi trong vòng 3 ngày
-
`FSharpValue.PreComputeTuplePropertyInfo` reports an out-of-range index for every struct tupleCó thể đã có người làm @T-Gro đã nhận 3 ngày trước. Đang mởBug Needs-Triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 64/100
Maintainer thường phản hồi trong vòng 3 ngày
-
Semantic classification cache for opened documents is never populated (written to the unopened-documents cache)Có thể đã có người làm @xperiandri đã nhận 48 ngày trước. Đang mởNeeds-Triage
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 90/100
Maintainer thường phản hồi trong vòng 3 ngày
-
Needs-Triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
dotnet/fsharp#20265 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 3 ngày
-
Bug Needs-Triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 3 ngày
Tất cả issue của dotnet/fsharp
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
maniator/verticopolis#1303 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
`@vanilla-extract/turbopack-plugin`: "getImageSize is not a function" with Next.js 16.4.x when a `.css.ts` file imports an imageCó thể đã có người làm @aevarOrigo đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
vanilla-extract-css/vanilla-extract#1799 · 1 bình luận ·
-
followup
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 83/100
Maintainer thường phản hồi trong vòng 1 ngày
-
matplotlibĐang mở
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 73/100
nansencenter/xhycom#29 ·
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 73/100
Adyen/adyen-react-native#1236 ·