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-4023] Type checker can't figure out constructor with default parameter in lazy property #46606

Closed
NachoSoto opened this issue Feb 21, 2017 · 3 comments
Assignees
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. compiler The Swift compiler in itself diagnostics QoI Bug: Diagnostics Quality of Implementation type checker Area → compiler: Semantic analysis

Comments

@NachoSoto
Copy link
Contributor

Previous ID SR-4023
Radar None
Original Reporter @NachoSoto
Type Bug
Status Resolved
Resolution Duplicate
Environment

Swift version 3.0.2 (swiftlang-800.0.63 clang-800.0.42.1)
Swift version 4.0 (swiftlang-900.0.43 clang-900.0.22.8)

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

md5: b7fb7b6bb0584fdaafe946763084c5a0

duplicates:

  • SR-2616 'lazy' keyword results in "Type of expression is ambiguous without more context"

Issue Description:

class A {
    init(b: Bool = false) {}
}
class B {
    lazy var a = A()
}
error: repl.swift:5:18: error: type of expression is ambiguous without more context
    lazy var a = A()
                 ^~~
@NachoSoto
Copy link
Contributor Author

Thanks @belkadan!

@NachoSoto
Copy link
Contributor Author

Still getting the same error in Swift version 4.0 (swiftlang-900.0.43 clang-900.0.22.8):

error: repl.swift:5:18: error: type of expression is ambiguous without more context
    lazy var a = A()
                 ^~~

@belkadan
Copy link
Contributor

Ah, this is another case of the fix not making beta 1. It'll be in beta 2 or 3 for sure.

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
This issue was closed.
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 in itself diagnostics QoI Bug: Diagnostics Quality of Implementation type checker Area → compiler: Semantic analysis
Projects
None yet
Development

No branches or pull requests

2 participants