Skip to content
New issue

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

[SR-13068] Ambiguous expression instead of specific error #55514

Open
swift-ci opened this issue Jun 24, 2020 · 0 comments
Open

[SR-13068] Ambiguous expression instead of specific error #55514

swift-ci opened this issue Jun 24, 2020 · 0 comments
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. compiler The Swift compiler itself diagnostics QoI Bug: Diagnostics Quality of Implementation type checker Area → compiler: Semantic analysis

Comments

@swift-ci
Copy link
Contributor

Previous ID SR-13068
Radar None
Original Reporter stevex (JIRA User)
Type Bug
Environment

Xcode 12.0 beta (12A6159) on Catalina.

Additional Detail from JIRA
Votes 0
Component/s Compiler
Labels Bug, DiagnosticsQoI, TypeChecker
Assignee None
Priority Medium

md5: 4cde12bc42c71a8af4bb02222eddbcd5

Issue Description:

This code gives "Type of expression is ambiguous without more context" on line 11 (the ZStack) when the actual error is type conversion on line 17.

/Users/stevex/Desktop/Demo/Demo/ContentView.swift:11:9: error: type of expression is ambiguous without more context
        ZStack {
import SwiftUI

class BoardMetrics: ObservableObject {
    @Published var cellSize = 30
}

struct CellView: View {
    @EnvironmentObject var boardMetrics: BoardMetrics

    var body: some View {
        ZStack {
            Rectangle()
                .border(Color.gray)
            
            Text("1")
                .border(Color.clear)
                .font(.system(size: Double(14 * boardMetrics.cellSize * 0.1)))
        }
    }
}
@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. compiler The Swift compiler itself diagnostics QoI Bug: Diagnostics Quality of Implementation type checker Area → compiler: Semantic analysis
Projects
None yet
Development

No branches or pull requests

1 participant