You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
airspeedswift opened this issue
Jan 26, 2018
· 4 comments
Assignees
Labels
bugA deviation from expected or documented behavior. Also: expected but undesirable behavior.compilerThe Swift compiler in itselfcrashBug: A crash, i.e., an abnormal termination of software
The cause appears to be that the Inner type is defined conditionally (when Bound: Strideable) but the conditional conformance leaves this out.
To fix the crasher, add the necessary conditions for Inner to exist. Instead this should be implied, or generate a compiler warning. (my preference is implied, and I think that's more in keeping with other similar situations)
This is a reduction of the implementation for CountableRange.Index: Hashable where Bound: Hashable
structS<T: Comparable> { }
// Inner only exists where T: StrideableextensionSwhereT: Strideable {
structInner { }
varinner: Inner { returnInner() }
}
extensionS.Inner: Equatable {
staticfunc == (lhs: S<T>.Inner, rhs: S<T>.Inner) -> Bool { returntrue }
}
// T: Strideable should be inferred, or maybe required,// but currently it just crashes on compilationextensionS.Inner: HashablewhereT: Hashable// uncomment to make it compile...// , T: Strideable
{
varhashValue: Int { return0 }
}
lets = S<Int>()
leti = s.inner.hashValueprint(i)
The text was updated successfully, but these errors were encountered:
bugA deviation from expected or documented behavior. Also: expected but undesirable behavior.compilerThe Swift compiler in itselfcrashBug: A crash, i.e., an abnormal termination of software
Additional Detail from JIRA
md5: e8456335d92edf60e1adcc1da963def0
Issue Description:
The following currently crashes on compilation.
The cause appears to be that the
Inner
type is defined conditionally (whenBound: Strideable
) but the conditional conformance leaves this out.To fix the crasher, add the necessary conditions for
Inner
to exist. Instead this should be implied, or generate a compiler warning. (my preference is implied, and I think that's more in keeping with other similar situations)This is a reduction of the implementation for
CountableRange.Index: Hashable where Bound: Hashable
The text was updated successfully, but these errors were encountered: