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
swift-ci opened this issue
Apr 6, 2018
· 6 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 softwareIRGenLLVM IR generation
The following code sample is the minimal example which I could extract from my production code.
If you do the actions described in only one of the comment lines the error ("Command failed due to signal: Illegal instruction: 4") goes away and the project compiles perfectly fine.
protocolTypedParserResultTransferType {
// Remove type constraintassociatedtypeResult: ParserResult
}
structAnyTypedParserResultTransferType<P: ParserResult>: TypedParserResultTransferType {
typealiasResult = P// Remove propertyletresult: P
}
protocolParserResult {}
protocolStaticParser: ParserResult {}
// Change comformance to ParserResultprotocolTypedStaticParser: StaticParser {
// Remove type constraintassociatedtypeResultTransferType: TypedParserResultTransferType
}
// Remove where clauseprotocolMutableSelfStaticParser: TypedStaticParserwhereResultTransferType == AnyTypedParserResultTransferType<Self> {
funcparseTypeVar() -> AnyTypedParserResultTransferType<Self>
}
extensionMutableSelfStaticParser {
funcanyFunction() -> () {
lett = self.parseTypeVar// Remove this and below_ = t()
_ = self.parseTypeVar()
}
}
The text was updated successfully, but these errors were encountered:
GenericSignature::getConformanceAccessPath is telling us that the access path to Self: ParserResult (required to build the type metadata for AnyTypedParserResultTransferType<Self>) is
τ_0_0.ResultTransferType is concretely known to be AnyTypedParserResultTransferType<Self> because of the same-type constraint on MutableSelfStaticParser. Its type metadata must be passed to the associated conformance accessor for τ_0_0.Result: ParserResult. Because it is no longer an archetype, we lose the information that it's available via an associated type accessor, and so we try to build it from scratch, which requires Self: ParserResult.
So this is something we could potentially solve in IRGen by recognizing that we have a better access to AnyTypedParserResultTransferType<Self> than just building it from scratch. But arguably it also ought to be fixed in the AST by not offering us this bizarre access path in the first place.
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 softwareIRGenLLVM IR generation
Environment
Xcode 9.3; Swift 4.1
Additional Detail from JIRA
md5: 80d16503eb4fe0452484c8eaaad06f28
Issue Description:
The following code sample is the minimal example which I could extract from my production code.
If you do the actions described in only one of the comment lines the error ("Command failed due to signal: Illegal instruction: 4") goes away and the project compiles perfectly fine.
The text was updated successfully, but these errors were encountered: