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

Failing ParseableInterface test #73

Open
rxwei opened this issue Dec 14, 2021 · 4 comments
Open

Failing ParseableInterface test #73

rxwei opened this issue Dec 14, 2021 · 4 comments

Comments

@rxwei
Copy link
Member

rxwei commented Dec 14, 2021

_MatchingEngine is failing the ParseableInterface test in the Swift repo.

/Volumes/Media/Development/Swift/swift-source/build/Ninja-ReleaseAssert/swift-macosx-x86_64/lib/swift/macosx/_MatchingEngine.swiftmodule/x86_64-apple-macos.swiftinterface:1460:1: error: type 'TypedIndex<C, 👻>' does not conform to protocol 'RangeReplaceableCollection'
extension _MatchingEngine.TypedIndex : Swift.RangeReplaceableCollection where C : Swift.RangeReplaceableCollection {
^
/Volumes/Media/Development/Swift/swift-source/build/Ninja-ReleaseAssert/swift-macosx-x86_64/lib/swift/macosx/_MatchingEngine.swiftmodule/x86_64-apple-macos.swiftinterface:1460:1: error: unavailable instance method 'replaceSubrange(_:with:)' was used to satisfy a requirement of protocol 'RangeReplaceableCollection'
extension _MatchingEngine.TypedIndex : Swift.RangeReplaceableCollection where C : Swift.RangeReplaceableCollection {
^
Swift.RangeReplaceableCollection:4:26: note: 'replaceSubrange(_:with:)' declared here
    public mutating func replaceSubrange<C>(_ subrange: Range<Self.Index>, with newElements: C) where C : Collection, Self.Element == C.Element
                         ^
Swift.RangeReplaceableCollection:4:19: note: requirement 'replaceSubrange(_:with:)' declared here
    mutating func replaceSubrange<C>(_ subrange: Range<Self.Index>, with newElements: __owned C) where C : Collection, Self.Element == C.Element
                  ^
/Volumes/Media/Development/Swift/swift-source/build/Ninja-ReleaseAssert/swift-macosx-x86_64/lib/swift/macosx/_MatchingEngine.swiftmodule/x86_64-apple-macos.swiftinterface:1464:14: error: no exact matches in call to instance method 'replaceSubrange'
    rawValue.replaceSubrange(rawRange, with: newElements)
             ^
Swift.RangeReplaceableCollection:4:19: note: candidate requires that the types 'C.Element' and 'C.Element' be equivalent (requirement specified as 'Self.Element' == 'C.Element')
    mutating func replaceSubrange<C>(_ subrange: Range<Self.Index>, with newElements: __owned C) where C : Collection, Self.Element == C.Element
                  ^
Swift.RangeReplaceableCollection:2:37: note: candidate requires that the types 'C.Element' and 'C.Element' be equivalent (requirement specified as 'Self.Element' == 'C.Element')
    @inlinable public mutating func replaceSubrange<C, R>(_ subrange: R, with newElements: __owned C) where C : Collection, R : RangeExpression, Self.Element == C.Element, Self.Index == R.Bound
                                    ^
/Volumes/Media/Development/Swift/swift-source/build/Ninja-ReleaseAssert/swift-macosx-x86_64/lib/swift/macosx/_MatchingEngine.swiftmodule/x86_64-apple-macos.swiftinterface:1:1: error: failed to build module '_MatchingEngine' for importation due to the errors above; the textual interface may be broken by project issues or a compiler bug
// swift-interface-format-version: 1.0
^

--

********************
********************
Failed Tests (1):
  Swift-validation(macosx-x86_64) :: ParseableInterface/verify_all_overlays.py
@rxwei
Copy link
Member Author

rxwei commented Dec 14, 2021

Removing @_alwaysEmitIntoClient gets rid of the last error.

--
/Volumes/Media/Development/Swift/swift-source/build/Ninja-ReleaseAssert/swift-macosx-x86_64/lib/swift/macosx/_MatchingEngine.swiftmodule/x86_64-apple-macos.swiftinterface:1460:1: error: type 'TypedIndex<C, 👻>' does not conform to protocol 'RangeReplaceableCollection'
extension _MatchingEngine.TypedIndex : Swift.RangeReplaceableCollection where C : Swift.RangeReplaceableCollection {
^
/Volumes/Media/Development/Swift/swift-source/build/Ninja-ReleaseAssert/swift-macosx-x86_64/lib/swift/macosx/_MatchingEngine.swiftmodule/x86_64-apple-macos.swiftinterface:1460:1: error: unavailable instance method 'replaceSubrange(_:with:)' was used to satisfy a requirement of protocol 'RangeReplaceableCollection'
extension _MatchingEngine.TypedIndex : Swift.RangeReplaceableCollection where C : Swift.RangeReplaceableCollection {
^
Swift.RangeReplaceableCollection:4:26: note: 'replaceSubrange(_:with:)' declared here
    public mutating func replaceSubrange<C>(_ subrange: Range<Self.Index>, with newElements: C) where C : Collection, Self.Element == C.Element
                         ^
Swift.RangeReplaceableCollection:4:19: note: requirement 'replaceSubrange(_:with:)' declared here
    mutating func replaceSubrange<C>(_ subrange: Range<Self.Index>, with newElements: __owned C) where C : Collection, Self.Element == C.Element
                  ^
/Volumes/Media/Development/Swift/swift-source/build/Ninja-ReleaseAssert/swift-macosx-x86_64/lib/swift/macosx/_MatchingEngine.swiftmodule/x86_64-apple-macos.swiftinterface:1:1: error: failed to build module '_MatchingEngine' for importation due to the errors above; the textual interface may be broken by project issues or a compiler bug
// swift-interface-format-version: 1.0
^

The remaining error still claims that it's using the unavailable'd method. Not sure why it did not resolve to the local definition of replaceSubrange(_:with:).

@rxwei
Copy link
Member Author

rxwei commented Dec 14, 2021

@_implements(RangeReplaceableCollection, replaceSubrange(_:with:)) doesn't work either:

Swift.RangeReplaceableCollection:4:19: Multiple matching functions named 'replaceSubrange(_:with:)' with type '<C> (Range<TypedIndex<C, 👻>.Index>, with: __owned C) -> ()' (aka '<C> (Range<TypedInt<👻>>, with: __owned C) -> ()')
TypedIndex.swift:84:24: Candidate exactly matches [with SubSequence = TypedIndex<C, 👻>.SubSequence]
TypedIndex.swift:84:24: Candidate exactly matches [with SubSequence = TypedIndex<C, 👻>.SubSequence]
TypedIndex.swift:84:24: Candidate exactly matches [with SubSequence = TypedIndex<C, 👻>.SubSequence]
TypedIndex.swift:84:24: Candidate exactly matches [with SubSequence = TypedIndex<C, 👻>.SubSequence]
Swift.RangeReplaceableCollection:2:37: Candidate exactly matches [with SubSequence = TypedIndex<C, 👻>.SubSequence]

rxwei added a commit to rxwei/swift-experimental-string-processing that referenced this issue Dec 14, 2021
Disables `RangeReplaceableCollection` conformance for now until we find a way to declare a conformance without triggering apple#73.
@milseman
Copy link
Collaborator

We can drop the attributes. They were for when Util was a separate module, and currently only benefit prototypes. Prototypes can issue function calls. I can look into removing RRC, because it mostly just needs append IIRC

milseman pushed a commit that referenced this issue Dec 14, 2021
Disables `RangeReplaceableCollection` conformance for now until we find a way to declare a conformance without triggering #73.
@milseman
Copy link
Collaborator

milseman commented May 6, 2022

@rxwei is there anything left to track here, or should we close this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants