Skip to content

[SR-3118] Assertion failed: (env && "dependent type in non-generic context"), function mapTypeIntoContext, file /Users/blangmuir/src/s/swift/lib/AST/ArchetypeBuilder.cpp, line 1988. #45706

@benlangmuir

Description

@benlangmuir
Previous ID SR-3118
Radar rdar://problem/29070439
Original Reporter @benlangmuir
Type Bug
Status Resolved
Resolution Done
Additional Detail from JIRA
Votes 0
Component/s Compiler
Labels Bug, CompilerCrash
Assignee @rudkx
Priority Medium

md5: 1c32f9e101f2b2fa178bf43e78492de8

Issue Description:

This is validation-test/compiler_crashers/28447-result-case-not-implemented-failed.swift

I'm filing a specific bug for it because this test doesn't crash 100% of the time, so I'm going to disable it and don't want us to lose track of it.

Assertion failed: (env && "dependent type in non-generic context"), function mapTypeIntoContext, file /Users/blangmuir/src/s/swift/lib/AST/ArchetypeBuilder.cpp, line 1988.
4   libsystem_c.dylib               0x00007fffaea34893 __assert_rtn + 320
5   swiftc                          0x0000000107a6b6cd swift::ArchetypeBuilder::mapTypeIntoContext(swift::DeclContext const*, swift::Type) + 157
6   swiftc                          0x000000010799ead6 canSynthesizeRawRepresentable(swift::TypeChecker&, swift::Decl*, swift::EnumDecl*) + 86 (DerivedConformanceRawRepresentable.cpp:357)
7   swiftc                          0x000000010799ed4a swift::DerivedConformance::deriveRawRepresentable(swift::TypeChecker&, swift::Decl*, swift::NominalTypeDecl*, swift::AssociatedTypeDecl*) + 58 (DerivedConformanceRawRepresentable.cpp:429)
8   swiftc                          0x0000000107a41bd5 std::__1::__function::__func<(anonymous namespace)::ConformanceChecker::resolveTypeWitnesses()::$_33, std::__1::allocator<(anonymous namespace)::ConformanceChecker::resolveTypeWitnesses()::$_33>, void (unsigned int)>::operator()(unsigned int&&) + 1397 (TypeCheckProtocol.cpp:3102)
9   swiftc                          0x0000000107a2fa13 (anonymous namespace)::ConformanceChecker::resolveTypeWitnesses() + 1011 (vector:1467)
10  swiftc                          0x0000000107a2b5c9 swift::TypeChecker::checkConformance(swift::NormalProtocolConformance*) + 1305 (Type.h:115)
11  swiftc                          0x0000000107a2bdad swift::TypeChecker::checkConformancesInContext(swift::DeclContext*, swift::IterableDeclContext*) + 461 (TypeCheckProtocol.cpp:4787)
12  swiftc                          0x00000001079f128b (anonymous namespace)::DeclChecker::visitEnumDecl(swift::EnumDecl*) + 923 (TypeCheckDecl.cpp:4037)
13  swiftc                          0x00000001079e4321 (anonymous namespace)::DeclChecker::visit(swift::Decl*) + 369 (DeclNodes.def:112)
14  swiftc                          0x00000001079e419c swift::TypeChecker::typeCheckDecl(swift::Decl*, bool) + 156 (TypeCheckDecl.cpp:6802)
15  swiftc                          0x0000000107a54c86 swift::ASTVisitor<(anonymous namespace)::StmtChecker, void, swift::Stmt*, void, void, void, void>::visit(swift::Stmt*) + 454 (TypeCheckStmt.cpp:1200)
16  swiftc                          0x0000000107a53fe9 (anonymous namespace)::StmtChecker::typeCheckBody(swift::BraceStmt*&) + 25 (Casting.h:268)
17  swiftc                          0x0000000107a5343f swift::TypeChecker::typeCheckFunctionBodyUntil(swift::FuncDecl*, swift::SourceLoc) + 383 (Decl.h:4593)
18  swiftc                          0x0000000107a53263 swift::TypeChecker::typeCheckAbstractFunctionBodyUntil(swift::AbstractFunctionDecl*, swift::SourceLoc) + 35 (TypeCheckStmt.cpp:1237)
19  swiftc                          0x0000000107a53de4 swift::TypeChecker::typeCheckAbstractFunctionBody(swift::AbstractFunctionDecl*) + 180 (TypeCheckStmt.cpp:1254)
20  swiftc                          0x0000000107a06ea6 typeCheckFunctionsAndExternalDecls(swift::TypeChecker&) + 166 (Decl.h:4539)
21  swiftc                          0x0000000107a07b40 swift::performTypeChecking(swift::SourceFile&, swift::TopLevelContext&, swift::OptionSet<swift::TypeCheckingFlags, unsigned int>, unsigned int, unsigned int) + 1568 (Optional.h:109)
22  swiftc                          0x00000001076a1400 swift::CompilerInstance::performSema() + 3664 (vector:641)
23  swiftc                          0x00000001071589eb swift::performFrontend(llvm::ArrayRef<char const*>, char const*, void*, swift::FrontendObserver*) + 3163 (FrontendTool.cpp:760)
24  swiftc                          0x0000000107115930 main + 2576 (driver.cpp:160)
25  libdyld.dylib                   0x00007fffae9d9255 start + 1

Metadata

Metadata

Assignees

Labels

bugA deviation from expected or documented behavior. Also: expected but undesirable behavior.compilerThe Swift compiler itselfcrashBug: A crash, i.e., an abnormal termination of software

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions