swiftlang / swift

The Swift Programming Language
https://swift.org
Apache License 2.0
67.6k stars 10.37k forks source link

'retroactive' attribute does not apply; 'ExpressibleByBooleanLiteral' is declared in this module when adding retroactive conformance of type defined in the same package #76724

Closed ahoppen closed 1 month ago

ahoppen commented 1 month ago

I have a package with

Lib.swift

public struct MyLib {}

Test.swift

import Lib

extension MyLib: @retroactive ExpressibleByBooleanLiteral {
  public init(booleanLiteral value: BooleanLiteralType) {}
}

This gives me an error saying

Test.swift:3:18: error: 'retroactive' attribute does not apply; 'ExpressibleByBooleanLiteral' is declared in this module

I assume what’s meant hers is

Test.swift:3:18: error: 'retroactive' attribute does not apply; 'MyLib' is declared in this package
tshortli commented 1 month ago

Fixed by https://github.com/swiftlang/swift/pull/76189.