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-764] swiftc calls default initializers "synthesized initializers" #43376

Open
swift-ci opened this issue Feb 18, 2016 · 2 comments · May be fixed by #68856
Open

[SR-764] swiftc calls default initializers "synthesized initializers" #43376

swift-ci opened this issue Feb 18, 2016 · 2 comments · May be fixed by #68856
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. class Feature → type declarations: Class declarations compiler The Swift compiler itself diagnostics QoI Bug: Diagnostics Quality of Implementation good first issue Good for newcomers properties Feature: properties type checker Area → compiler: Semantic analysis

Comments

@swift-ci
Copy link
Contributor

Previous ID SR-764
Radar None
Original Reporter jaybuff (JIRA User)
Type Bug
Additional Detail from JIRA
Votes 0
Component/s Compiler
Labels Bug, DiagnosticsQoI
Assignee None
Priority Medium

md5: 1956d3a3ee2e5ca9643b40e9f5d947b5

Issue Description:

$ cat Circle.swift
class Circle {
    var radius: Int
}

$ swiftc Circle.swift
Circle.swift:1:7: error: class 'Circle' has no initializers
class Circle {
      ^
Circle.swift:2:9: note: stored property 'radius' without initial value prevents synthesized initializers
    var radius: Int
        ^
                    = 0

Note that the error refers to "synthesized initializers" The canonical swift book refers to these as "Default Initializers"

Either the book or the compiler error message should be changed to consistently call these the same thing.

@belkadan
Copy link
Contributor

"Synthesized initializers" covers more than just the default initializer; it also would include any designated initializers inherited from a parent. I suppose we could special-case the diagnostic for each situation, though.

@swift-ci
Copy link
Contributor Author

Comment by Jay Buffington (JIRA)

When developers new to swift are encountered with this error the first instinct is to likely look up the term "synthesized initializers" in the book (or google it- which would hopefully direct them to the book). However, the book makes no mention of the phrase.

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
@AnthonyLatsis AnthonyLatsis added good first issue Good for newcomers type checker Area → compiler: Semantic analysis labels Jul 5, 2022
@AnthonyLatsis AnthonyLatsis added class Feature → type declarations: Class declarations properties Feature: properties labels Sep 9, 2023
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. class Feature → type declarations: Class declarations compiler The Swift compiler itself diagnostics QoI Bug: Diagnostics Quality of Implementation good first issue Good for newcomers properties Feature: properties type checker Area → compiler: Semantic analysis
Projects
None yet
3 participants