Convert Int.max to CInt cause crash :) #45
Labels
No Label
bug
duplicate
enhancement
help wanted
invalid
question
wontfix
No Milestone
No Assignees
1 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: aparoksha/adwaita-swift#45
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Describe the bug
cause crash because .max became from Int which Int64 on aarch64 and x86_64 arches :)
but we try to convert it to CInt which Int32 under the hood :)
To Reproduce
.frame(maxWidth: .max)
to it (because there is no .infinity variant from SwiftUI)Expected behavior
Not crash :)
Additional context
I suppose that we need to perform a lossy conversion from Int (which is a synonym for Int64) to CInt (a synonym for Int32) when casting, or not use Int in functions which use CInt at all :)
Workaround:
Thanks for the report! I'll fix this (currently I don't have access to my laptop).
I think you're expecting setting the maximum width to infinity make the view expand horizontally? If this is your goal, use
hexpand(_:)
instead.frame(maxWidth:)
only makes sense when restricting the width.I fixed this in
018d21ee65
(1.0.0 branch). It will be fixed in the 1.0.0 release.