Skip to content

[SR-14659] Assertion failed: (isCanonicalAnchor(secondType)), function getCanonical, #57011

@benlangmuir

Description

@benlangmuir
Previous ID SR-14659
Radar rdar://78481510
Original Reporter @benlangmuir
Type Bug
Status Resolved
Resolution Done

Attachment: Download

Environment

Swift 5.4

Additional Detail from JIRA
Votes 0
Component/s Compiler
Labels Bug
Assignee @slavapestov
Priority Medium

md5: 8056b0a6f227c024519ae2611075212b

Issue Description:

Jenkins URL: https://ci.swift.org/job/swift-5.4-source-compat-suite-debug/123

Assertion failed: (isCanonicalAnchor(secondType)), function getCanonical, file /Volumes/swift-ci/jenkins/workspace-private/swift-5.4-source-compat-suite-debug/swift/lib/AST/GenericSignature.cpp, line 251.
Please submit a bug report (https://swift.org/contributing/#reporting-bugs) and include the project and the crash backtrace.
Stack dump:
<snip>
3.  While evaluating request TypeCheckSourceFileRequest(source_file "/Volumes/swift-ci/jenkins/workspace/swift-5.4-source-compat-suite-debug/swift-source-compat-suite/project_cache/Doggie/Sources/DoggieGraphics/ColorPixel/Gray/Gray16ColorPixel.swift")
4.  While type-checking 'Gray16ColorPixel' (at /Volumes/swift-ci/jenkins/workspace/swift-5.4-source-compat-suite-debug/swift-source-compat-suite/project_cache/Doggie/Sources/DoggieGraphics/ColorPixel/Gray/Gray16ColorPixel.swift:27:8)
5.  While type-checking protocol conformance to '_GrayColorPixel' (at /Volumes/swift-ci/jenkins/workspace/swift-5.4-source-compat-suite-debug/swift-source-compat-suite/project_cache/Doggie/Sources/DoggieGraphics/ColorPixel/Gray/GrayColorPixel.swift:50:8) for type 'Gray16ColorPixel' (declared at [/Volumes/swift-ci/jenkins/workspace/swift-5.4-source-compat-suite-debug/swift-source-compat-suite/project_cache/Doggie/Sources/DoggieGraphics/ColorPixel/Gray/Gray16ColorPixel.swift:27:8 - line:38:1] RangeText="struct Gray16ColorPixel: _GrayColorPixel {
    
    public var w: UInt8
    public var a: UInt8
    
    @inlinable
    @inline(__always)
    public init(white: UInt8, opacity: UInt8 = 0xFF) {
        self.w = white
        self.a = opacity
    }
")
6.  While evaluating request TypeWitnessRequest(Gray16ColorPixel: ColorPixel module DoggieGraphics, DoggieGraphics.(file).ColorPixel.Model@/Volumes/swift-ci/jenkins/workspace/swift-5.4-source-compat-suite-debug/swift-source-compat-suite/project_cache/Doggie/Sources/DoggieGraphics/ColorPixel/ColorPixel.swift:28:20)
7.  While evaluating request InterfaceTypeRequest(DoggieGraphics.(file).ColorPixel.init(_:)@/Volumes/swift-ci/jenkins/workspace/swift-5.4-source-compat-suite-debug/swift-source-compat-suite/project_cache/Doggie/Sources/DoggieGraphics/ColorPixel/ColorPixel.swift:34:5)
8.  While canonicalizing generic signature <τ_0_0, τ_1_0 where τ_0_0 : ColorPixel, τ_1_0 : ColorPixel, τ_0_0.Model == τ_1_0.Model, τ_0_0.Model.Float16Components == τ_1_0.Model.Float16Components.Model.Float16Components> in requirement #&#8203;3
0  swift-frontend           0x0000000104cf00c5 llvm::sys::PrintStackTrace(llvm::raw_ostream&) + 37
1  swift-frontend           0x0000000104cef008 llvm::sys::RunSignalHandlers() + 248
2  swift-frontend           0x0000000104cf06a6 SignalHandler(int) + 262
3  libsystem_platform.dylib 0x00007fff6fac55fd _sigtramp + 29
4  libsystem_platform.dylib 0x00007ffeef8ed080 _sigtramp + 18446744071560133280
5  libsystem_c.dylib        0x00007fff6f99b808 abort + 120
6  libsystem_c.dylib        0x00007fff6f99aac6 err + 0
7  swift-frontend           0x000000010526d0a3 swift::CanGenericSignature::getCanonical(swift::ArrayRefView<swift::Type, swift::GenericTypeParamType*, swift::GenericTypeParamType* swift::staticCastHelper<swift::GenericTypeParamType>(swift::Type const&), true>, llvm::ArrayRef<swift::Requirement>, bool) (.cold.45) + 35
8  swift-frontend           0x000000010159f68d swift::CanGenericSignature::getCanonical(swift::ArrayRefView<swift::Type, swift::GenericTypeParamType*, swift::GenericTypeParamType* swift::staticCastHelper<swift::GenericTypeParamType>(swift::Type const&), true>, llvm::ArrayRef<swift::Requirement>, bool) + 2637
9  swift-frontend           0x000000010159eae0 swift::GenericSignatureImpl::getCanonicalSignature() const + 48
10 swift-frontend           0x000000010159ea96 swift::GenericSignatureImpl::isCanonical() const + 22
11 swift-frontend           0x00000001013bcf95 swift::GenericFunctionType::get(swift::GenericSignature, llvm::ArrayRef<swift::AnyFunctionType::Param>, swift::Type, swift::ASTExtInfo) + 261
12 swift-frontend           0x0000000101154961 swift::InterfaceTypeRequest::evaluate(swift::Evaluator&, swift::ValueDecl*) const + 1697
13 swift-frontend           0x00000001014d4e42 llvm::Expected<swift::InterfaceTypeRequest::OutputType> swift::Evaluator::getResultUncached<swift::InterfaceTypeRequest>(swift::InterfaceTypeRequest const&) + 498
14 swift-frontend           0x00000001014d4b8b llvm::Expected<swift::InterfaceTypeRequest::OutputType> swift::Evaluator::getResultCached<swift::InterfaceTypeRequest, (void*)0>(swift::InterfaceTypeRequest const&) + 107
15 swift-frontend           0x000000010148cfd5 swift::InterfaceTypeRequest::OutputType swift::evaluateOrDefault<swift::InterfaceTypeRequest>(swift::Evaluator&, swift::InterfaceTypeRequest, swift::InterfaceTypeRequest::OutputType) + 37
16 swift-frontend           0x0000000101482bce swift::Decl::isInvalid() const + 238
17 swift-frontend           0x00000001011dd507 swift::AssociatedTypeInference::inferTypeWitnessesViaValueWitnesses(swift::ConformanceChecker&, llvm::SetVector<swift::AssociatedTypeDecl*, std::__1::vector<swift::AssociatedTypeDecl*, std::__1::allocator<swift::AssociatedTypeDecl*> >, llvm::DenseSet<swift::AssociatedTypeDecl*, llvm::DenseMapInfo<swift::AssociatedTypeDecl*> > > const&) + 583
18 swift-frontend           0x00000001011e225a swift::AssociatedTypeInference::solve(swift::ConformanceChecker&) + 442
19 swift-frontend           0x00000001011e2f2f swift::ConformanceChecker::resolveTypeWitnesses() + 271
20 swift-frontend           0x00000001011e309b swift::ConformanceChecker::resolveSingleTypeWitness(swift::AssociatedTypeDecl*) + 27
21 swift-frontend           0x00000001011c5515 swift::TypeWitnessRequest::evaluate(swift::Evaluator&, swift::NormalProtocolConformance*, swift::AssociatedTypeDecl*) const + 517
22 swift-frontend           0x0000000101646962 llvm::Expected<swift::TypeWitnessRequest::OutputType> swift::Evaluator::getResultUncached<swift::TypeWitnessRequest>(swift::TypeWitnessRequest const&) + 498
23 swift-frontend           0x00000001016466b3 llvm::Expected<swift::TypeWitnessRequest::OutputType> swift::Evaluator::getResultCached<swift::TypeWitnessRequest, (void*)0>(swift::TypeWitnessRequest const&) + 115
24 swift-frontend           0x00000001016438ce swift::TypeWitnessRequest::OutputType swift::evaluateOrDefault<swift::TypeWitnessRequest>(swift::Evaluator&, swift::TypeWitnessRequest, swift::TypeWitnessRequest::OutputType) + 46
25 swift-frontend           0x0000000101641eba swift::NormalProtocolConformance::getTypeWitnessAndDecl(swift::AssociatedTypeDecl*, swift::SubstOptions) const + 378
26 swift-frontend           0x0000000101641b9e swift::ProtocolConformance::getTypeWitnessAndDecl(swift::AssociatedTypeDecl*, swift::SubstOptions) const + 286
27 swift-frontend           0x00000001016602db getMemberForBaseType(llvm::function_ref<swift::ProtocolConformanceRef (swift::CanType, swift::Type, swift::ProtocolDecl*)>, swift::Type, swift::Type, swift::AssociatedTypeDecl*, swift::Identifier, swift::SubstOptions) + 923
28 swift-frontend           0x000000010166967e llvm::Optional<swift::Type> llvm::function_ref<llvm::Optional<swift::Type> (swift::TypeBase*)>::callback_fn<substType(swift::Type, llvm::function_ref<swift::Type (swift::SubstitutableType*)>, llvm::function_ref<swift::ProtocolConformanceRef (swift::CanType, swift::Type, swift::ProtocolDecl*)>, swift::SubstOptions)::$_26>(long, swift::TypeBase*) + 2622
29 swift-frontend           0x0000000101662534 swift::Type::transformRec(llvm::function_ref<llvm::Optional<swift::Type> (swift::TypeBase*)>) const + 68
30 swift-frontend           0x0000000101660659 substType(swift::Type, llvm::function_ref<swift::Type (swift::SubstitutableType*)>, llvm::function_ref<swift::ProtocolConformanceRef (swift::CanType, swift::Type, swift::ProtocolDecl*)>, swift::SubstOptions) + 297
31 swift-frontend           0x000000010166112f swift::Type::subst(llvm::function_ref<swift::Type (swift::SubstitutableType*)>, llvm::function_ref<swift::ProtocolConformanceRef (swift::CanType, swift::Type, swift::ProtocolDecl*)>, swift::SubstOptions) const + 127
32 swift-frontend           0x0000000101199dad llvm::Optional<swift::Requirement> swift::Requirement::subst<llvm::function_ref<swift::Type (swift::SubstitutableType*)>&, swift::LookUpConformanceInModule, swift::SubstOptions&>(llvm::function_ref<swift::Type (swift::SubstitutableType*)>&, swift::LookUpConformanceInModule&&, swift::SubstOptions&) const + 173
33 swift-frontend           0x0000000101199299 swift::TypeChecker::checkGenericArguments(swift::DeclContext*, swift::SourceLoc, swift::SourceLoc, swift::Type, swift::ArrayRefView<swift::Type, swift::GenericTypeParamType*, swift::GenericTypeParamType* swift::staticCastHelper<swift::GenericTypeParamType>(swift::Type const&), true>, llvm::ArrayRef<swift::Requirement>, llvm::function_ref<swift::Type (swift::SubstitutableType*)>, swift::SubstOptions) + 553
34 swift-frontend           0x00000001011bfb11 swift::ConformanceChecker::ensureRequirementsAreSatisfied() + 289
35 swift-frontend           0x00000001011b941d swift::ConformanceChecker::checkConformance(swift::MissingWitnessDiagnosisKind) + 141
36 swift-frontend           0x00000001011b74be swift::MultiConformanceChecker::checkIndividualConformance(swift::NormalProtocolConformance*, bool) + 7790
37 swift-frontend           0x00000001011b5432 swift::MultiConformanceChecker::checkAllConformances() + 130
38 swift-frontend           0x00000001011c26fe swift::TypeChecker::checkConformancesInContext(swift::IterableDeclContext*) + 5070
39 swift-frontend           0x000000010117883f (anonymous namespace)::DeclChecker::visit(swift::Decl*) + 159
40 swift-frontend           0x0000000101178782 swift::TypeChecker::typeCheckDecl(swift::Decl*) + 130
41 swift-frontend           0x000000010122cc28 swift::TypeCheckSourceFileRequest::evaluate(swift::Evaluator&, swift::SourceFile*) const + 184
42 swift-frontend           0x000000010122dbb2 llvm::Expected<swift::TypeCheckSourceFileRequest::OutputType> swift::Evaluator::getResultUncached<swift::TypeCheckSourceFileRequest>(swift::TypeCheckSourceFileRequest const&) + 514
43 swift-frontend           0x000000010122d904 llvm::Expected<swift::TypeCheckSourceFileRequest::OutputType> swift::Evaluator::getResultCached<swift::TypeCheckSourceFileRequest, (void*)0>(swift::TypeCheckSourceFileRequest const&) + 100
44 swift-frontend           0x000000010122ca90 swift::TypeCheckSourceFileRequest::OutputType swift::evaluateOrDefault<swift::TypeCheckSourceFileRequest>(swift::Evaluator&, swift::TypeCheckSourceFileRequest, swift::TypeCheckSourceFileRequest::OutputType) + 32
45 swift-frontend           0x00000001004a0ffa swift::CompilerInstance::forEachFileToTypeCheck(llvm::function_ref<void (swift::SourceFile&)>) + 90
46 swift-frontend           0x00000001004a0eea swift::CompilerInstance::performSema() + 74
47 swift-frontend           0x000000010037be2a swift::performFrontend(llvm::ArrayRef<char const*>, char const*, void*, swift::FrontendObserver*) + 4506
48 swift-frontend           0x000000010030c27e main + 846
49 libdyld.dylib            0x00007fff6f8cccc9 start + 1

Metadata

Metadata

Assignees

Labels

bugA deviation from expected or documented behavior. Also: expected but undesirable behavior.compilerThe Swift compiler itself

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions