We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
md5: 7a374a66d7abb2fb105bcb0ce72e99a9
Issue Description:
import SwiftUI struct MyButtonStyle { let minWidth: Double? } extension View { func foo(minWidth: Double?) -> some View { EmptyView() } } struct FrameCGFloatAndDoubleXXX: View { static let width = CGFloat.zero let s = MyButtonStyle(minWidth: 2 * Self.width / 3) // same expression as below, it's fine here var body: some View { foo(minWidth: 2 * Self.width) // ok foo(minWidth: Self.width / 3) // ok foo(minWidth: 2 * Self.width / 3) // Error: Ambiguous use of operator '/' foo(minWidth: 2 * Self.width / 3.0) // this is ok foo(minWidth: 2 * Self.width / (3 as Double)) // this is ok, so cannot have more than 1 int looking literals? } }
The text was updated successfully, but these errors were encountered:
@swift-ci create
Sorry, something went wrong.
Simpler example:
import SwiftUI struct SomeView: View { let width: CGFloat = 0 func foo(_ v: Double) -> some View { EmptyView() } // not ok var body: some View { foo(2 * width / 3) // Error: Ambiguous use of operator '/' } // ok var body2: some View { foo(2 * width / 3) // yet this is ok return EmptyView() } }
See: https://forums.swift.org/t/why-calling-swiftui-color-redblue-compiler-can-infer-param-type-is-double-but-calling-with-init-redblue-alpha-it-cannot-and-must-use-explicit-double-literal/52427/4
No branches or pull requests
Additional Detail from JIRA
md5: 7a374a66d7abb2fb105bcb0ce72e99a9
Issue Description:
The text was updated successfully, but these errors were encountered: