[SR-1512] Assertion failure: "Already marked as a fixed binding" when implementing index(_:offsetBy:limit:) #44121
Labels
bug
A deviation from expected or documented behavior. Also: expected but undesirable behavior.
compiler
The Swift compiler in itself
crash
Bug: A crash, i.e., an abnormal termination of software
type checker
Area → compiler: Semantic analysis
Attachment: Download
Environment
Swift version 3.0-dev (LLVM 752e1430fc, Clang 1e6cba3ce3, Swift ad34f89)
Target: x86_64-apple-macosx10.9
On 10.11.4, trying to compile in Xcode or manually with command:
xcrun --toolchain swift3dev -sdk macosx swift test.swift
Additional Detail from JIRA
md5: 538ac21c4c0d1177c701d3635c827a82
is duplicated by:
Issue Description:
See attached code sample. Causes an assertion failure every time.
Commenting out the function: `public func index(_ idx: C.Index, offsetBy offset: C.IndexDistance, limitedBy limit: C.Index? = nil) -> C.Index` resolves the assertion failure.
My idea was that implementing this method may allow the compiler to emit more efficient calls when using WrappedCollection to wrap a RandomAccessCollection (as it would know the exact type of C). I don't know if that's true or not, but we shouldn't hit an assertion failure in any case.
The text was updated successfully, but these errors were encountered: