[Feature Request] No HelperCoder generated when check compilation condition
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 35/100
- issue の種類
- バグ
- 明瞭さ
- おおむね明確
- 活発さ
- 停滞
- 技術スタック
- swift
- 領域
- build-system
調査の方向性
Start by reproducing the reported build in a Swift package using the swiftSettings compilation condition and the provided ResponseAttributes and Response declarations. Read the macro and plugin paths that generate ResponseAttributesCoder, then check how they handle declarations inside #if conditions. Done means the conditional example compiles and generates the coder without breaking the working example.
索引モデルが issue の本文から書いたものです。
説明
- I have read the documentation.
Describe the bug
Below code works well.
working code
@Codable
@CodedAs<String?>
@CodedAt("operation")
protocol ResponseAttributes {}
@Codable
struct Response {
@CodedIn("data")
let id: String
@CodedIn("data")
let type: String
@CodedIn("data")
@CodedBy(ResponseAttributesCoder())
let attributes: ResponseAttributes
}
@Codable
struct RegistrationAttributes: ResponseAttributes, DynamicCodable {
static var identifier: DynamicCodableIdentifier<String?> { .one("REGISTRATION") }
let id: String
@CodedAt("status-code")
let statusCode: String
let operation: String
}
@Codable
struct VerificationAttributes: ResponseAttributes, DynamicCodable {
static var identifier: DynamicCodableIdentifier<String?> { .one(nil) }
let id: String
let operation: String?
let expiresIn: UInt
@CodedAt("xxx-token")
let xxxToken: String
@CodedAt("yyy-token")
let yyyToken: String
}
But the ResponseAttributesCoder will be missing if add #if SOME_SWIFT_ACTIVE_COMPILATION_CONDITION.
Xcode say 'Cannot find 'AnonymousAttestationResponseAttributesCoder' in scope'.
failed to work
// Have set the `SOME_SWIFT_ACTIVE_COMPILATION_CONDITION` in `swiftSettings` from `Package.swift`.
#if SOME_SWIFT_ACTIVE_COMPILATION_CONDITION
@Codable
@CodedAs<String?>
@CodedAt("operation")
protocol ResponseAttributes {}
@Codable
struct Response {
@CodedIn("data")
let id: String
@CodedIn("data")
let type: String
@CodedIn("data")
@CodedBy(ResponseAttributesCoder())
let attributes: ResponseAttributes
}
@Codable
struct RegistrationAttributes: ResponseAttributes, DynamicCodable {
static var identifier: DynamicCodableIdentifier<String?> { .one("REGISTRATION") }
let id: String
@CodedAt("status-code")
let statusCode: String
let operation: String
}
@Codable
struct VerificationAttributes: ResponseAttributes, DynamicCodable {
static var identifier: DynamicCodableIdentifier<String?> { .one(nil) }
let id: String
let operation: String?
let expiresIn: UInt
@CodedAt("xxx-token")
let xxxToken: String
@CodedAt("yyy-token")
let yyyToken: String
}
#endif
To Reproduce
Steps to reproduce the behavior:
- Create an empty swift package
- Add MetaCodable to dependencies
- Copy and paste the code above
- commnad + B
Expected behavior
Compilation condition check shouldn't fail plugin or macro.
Environment (please complete the following information, remove ones not applicable):
- OS: macOS
- Version 13.6.6
- Xcode 15.2
- Swift 5.9.2
- 主要言語
- Swift
- スター
- 779
- フォーク
- 46
- 平均マージ
- 9時間 7分
- マージ済み PR(30日)
- 2
環境構築
このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
SwiftyLab/MetaCodable のほかの issue
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
SwiftyLab/MetaCodable#169 ·
-
enhancement good first issue
難易度 4/5 3〜5日 初心者へのやさしさ 32/100
SwiftyLab/MetaCodable#49 · コメント 5 件 · リアクション 2 件 ·
SwiftyLab/MetaCodable の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
メンテナーはふだん 1 日以内に返信
-
RealtimeV2 fails to compile on Xcode 27.1 / Swift 6.4: ambiguous implicit access level for import of 'HTTPTypes'対応中かも このイシューにリンクされたプルリクエストがオープン中、またはマージ済みです。 オープンRealtime swift
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
supabase/supabase-swift#1647 ·
メンテナーはふだん 1 日以内に返信
-
[Pri] Low [Status] Ready for Dev [Type] Bug /Me
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
wordpress-mobile/WordPress-iOS#26279 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
bug good first issue
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
NobiResearch/Ovenbird#148 ·
メンテナーはふだん 1 日以内に返信
-
auth type: bug
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
googleapis/google-cloud-swift#1549 ·
メンテナーはふだん 1 日以内に返信