[generics-rep] Trivial genericShow blows up the call stack
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
- 25/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Cần làm rõ
- Mức độ hoạt động
- Đình trệ
- Lĩnh vực
- backend
Hướng nghiên cứu
Start by reading the genericShow and generic representation code referenced in the stack trace, then reproduce the failure with the VVis and Frame definitions in the issue. Trace why deriving Show for the nested generic types recurses until the stack overflows; done means identifying the cause and confirming a fix prevents the overflow for this example.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
I have the following code in my library:
data VVis a
= Fill a (Frame a)
| ...
derive instance genericVVis :: Generic (VVis a) _
instance showVVis :: Show a => Show (VVis a) where
show = genericShow
data Frame a = Frame
{ frameMax :: a
, frameMin :: a
}
derive instance genericFrame :: Generic (Frame a) _
instance showFrame :: Show a => Show (Frame a) where
show = genericShow
If I now load my code in a REPL and create the following trivial value:
> Fill 2.0 (Frame {frameMax: 1.0, frameMin: 0.0})
return new Data_Show.Show(Data_Generic_Rep_Show.genericShow(genericVVis)(Data_Generic_Rep_Show.genericShowSum(Data_Generic_Rep_Show.genericShowConstructor(Data_Generic_Rep_Show.genericShowArgsProduct(Data_Generic_Rep_Show.genericShowArgsArgument(dictShow))(Data_Generic_Rep_Show.genericShowArgsArgument(showFrame(dictShow))))(new Data_Symbol.IsSymbol(function () {
^
RangeError: Maximum call stack size exceeded
...
This is a very small value, so I don't understand why this is blowing up the call stack. Could somebody help me understand please?
- Ngôn ngữ chính
- PureScript
- Star
- 168
- Fork
- 90
- Merge trung bình
- 3 ngày 1 giờ
- Pull request đã merge (30 ngày)
- 1
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Không 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 purescript/purescript-prelude
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 57/100
purescript/purescript-prelude#317 · 1 reaction ·
-
Int bottom is not safeĐang mở
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 32/100
purescript/purescript-prelude#312 · 5 bình luận ·
-
add liftCompare & friendsĐang mở
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 25/100
purescript/purescript-prelude#310 · 5 bình luận ·
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 24/100
purescript/purescript-prelude#308 · 2 bình luận ·
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 35/100
purescript/purescript-prelude#307 · 1 bình luận · 1 reaction ·
Tất cả issue của purescript/purescript-prelude
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
-
ManageSieve proxy: a backend's NO/BYE greeting is skipped as a capability line and reported as EOFĐang mởbug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Mend: dependency security vulnerability
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
-
Mend: dependency security vulnerability
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
ManageIQ/manageiq-pods#1476 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
prime-radiant-inc/evener#6366 ·
Maintainer thường phản hồi trong vòng 1 ngày