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-10046] Decodable/Encodable synthesis for unavailable property produces location-less diagnostic #52449

Open
hamishknight opened this issue Mar 5, 2019 · 2 comments
Assignees
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. Codable Area → standard library: `Codable` and co. compiler The Swift compiler in itself type checker Area → compiler: Semantic analysis

Comments

@hamishknight
Copy link
Collaborator

Previous ID SR-10046
Radar rdar://problem/48702396
Original Reporter @hamishknight
Type Bug
Environment

Swift version 5.0-dev (LLVM 8d1b92b83c, Swift e3bea40079)
Target: x86_64-apple-darwin18.2.0

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

md5: a88da86a349fbfc6057ebd774b438c86

Issue Description:

For the following code:

struct S : Decodable {
  @available(*, unavailable)
  var i: Int
}

we currently produce the location-less diagnostic:

<unknown>:0: error: 'i' is unavailable
/Users/hamishknight/Desktop/Stochastic Projects/newnew/newnew/main.swift:160:7: note: 'i' has been explicitly marked unavailable here
  var i: Int
      ^

The same also applies to Encodable.

Either we should refuse to synthesise a conformance or we should ignore the availability of i within the synthesised body (like we do for the memberwise initialiser, as we emit its body in SILGen).

@AnnaZaks
Copy link
Mannequin

AnnaZaks mannequin commented Mar 8, 2019

+ @itaiferber

@beccadax
Copy link
Contributor

beccadax commented Mar 9, 2019

I'll take this one.

@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. Codable Area → standard library: `Codable` and co. compiler The Swift compiler in itself type checker Area → compiler: Semantic analysis
Projects
None yet
Development

No branches or pull requests

2 participants