`FSharpValue.PreComputeTuplePropertyInfo` reports an out-of-range index for every struct tuple
维护者通常 3 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 2/5
- 预计耗时
- 1-3 小时
- 新手友好度
- 64/100
- Issue 类型
- 缺陷
- 描述清晰度
- 描述清楚
- 活跃度
- 活跃
- 技术栈
- fsharp
调研方向
首先,在 FSharp.Core 源代码及其元组反射测试中定位 FSharpValue.PreComputeTuplePropertyInfo。检查 struct 元组的处理方式,以及当前越界异常是如何产生的;issue 提供了可用的替代方案 PreComputeTupleReader 和 GetTupleField。当支持使用 struct 元组的调用,或在失败时抛出文档所述的 ArgumentException 并引导用户使用这些替代方案,即表示完成。
由索引模型根据 Issue 内容生成。
描述
FSharpValue.PreComputeTuplePropertyInfo fails for every index of a struct tuple type, and the message says that the index is out of range. That sends the reader to the wrong cause: a struct tuple keeps its items in fields, and the method returns a PropertyInfo.
Repro steps
open Microsoft.FSharp.Reflection
FSharpValue.PreComputeTuplePropertyInfo (typeof<struct (int * string)>, 0)
Expected behavior
Either support for struct tuples, or an ArgumentException that says that a struct tuple has no item properties and names FSharpValue.PreComputeTupleReader and FSharpValue.GetTupleField, which work for it.
Actual behavior
System.ArgumentException: The tuple index '0' was out of range for tuple type 'System.ValueTuple`2[[System.Int32, System.Private.CoreLib, Version=10.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e],[System.String, System.Private.CoreLib, Version=10.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]]'. (Parameter 'index')
Known workarounds
FSharpValue.PreComputeTupleReader and FSharpValue.GetTupleField read struct tuples.
Related information
- FSharp.Core 10.1.0.0, .NET SDK 10.0.402 (
dotnet fsi), Windows 11 - #4240 fixed
FSharpValue.MakeTuplefor struct tuples.
- 主要语言
- F#
- 星标
- 4.3k
- 派生
- 881
- 平均合并
- 3 天 22 小时
- 30 天内合并 PR
- 105
环境准备
在浏览器里用你自己的 GitHub 账号启动这个项目的开发容器。
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
dotnet/fsharp 的其他 Issue
-
Bug Needs-Triage
难度 2/5 1-3 小时 新手友好度 72/100
维护者通常 3 天内回复
-
Documentation: Array.tryPick code example gives an error可能已有人在做 @T-Gro 于 3 天前认领。 未关闭Area-XmlDocs
难度 1/5 1 小时以内 新手友好度 78/100
dotnet/fsharp#20780 · 已指派 1 人 ·
维护者通常 3 天内回复
-
Semantic classification cache for opened documents is never populated (written to the unopened-documents cache)可能已有人在做 @xperiandri 于 45 天前认领。 未关闭Needs-Triage
难度 1/5 1 小时以内 新手友好度 90/100
维护者通常 3 天内回复
-
Needs-Triage
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 3 天内回复
-
Bug Needs-Triage
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 3 天内回复
相似的 Issue
-
Pull-through from gcr.io returns 500 when pulling using podman/buildah可能已有人在做 关联的 PR 仍在进行中或已合并。 未关闭Issue Triage-Needed
难度 2/5 1-3 小时 新手友好度 68/100
pulp/pulp_container#2581 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 68/100
oasdiff/oasdiff#1337 · 1 条评论 ·
维护者通常 1 天内回复
-
bug(trainer): CustomTrainer func_args with non literal values fail inside the TrainJob可能已有人在做 @avanishkasar 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 69/100
c1overzz/dsh-bili-scroll#35 ·
维护者通常 1 天内回复