Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SR-6990] Conditional conformances: crash with same type constraint to concrete #49538

Closed
huonw mannequin opened this issue Feb 13, 2018 · 2 comments
Closed

[SR-6990] Conditional conformances: crash with same type constraint to concrete #49538

huonw mannequin opened this issue Feb 13, 2018 · 2 comments
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

Comments

@huonw
Copy link
Mannequin

huonw mannequin commented Feb 13, 2018

Previous ID SR-6990
Radar rdar://problem/37291254
Original Reporter @huonw
Type Bug
Status Resolved
Resolution Done
Environment

Master compiler circa 2/11/2018.

Additional Detail from JIRA
Votes 0
Component/s Compiler
Labels Bug, CompilerCrash, TypeChecker
Assignee None
Priority Medium

md5: 8a058ad9d0950f2ae8c9c60eb20e410e

Issue Description:

public struct Foo<T> {}
extension Foo: Sequence where T == Int {
    public typealias Element = Float
    public typealias Iterator = IndexingIterator<[Float]>
    public func makeIterator() -> Iterator { fatalError() }
}
Assertion failed: (isa<X>(Val) && "cast<Ty>() argument of incompatible type!"), function cast, file /Users/huon/swift/llvm/include/llvm/Support/Casting.h, line 255.
0  swift                    0x000000010e02f34c llvm::sys::PrintStackTrace(llvm::raw_ostream&) + 60
1  swift                    0x000000010e02f949 PrintStackTraceSignalHandler(void*) + 25
2  swift                    0x000000010e02b179 llvm::sys::RunSignalHandlers() + 425
3  swift                    0x000000010e02fcb2 SignalHandler(int) + 354
4  libsystem_platform.dylib 0x00007fff50e27f5a _sigtramp + 26
5  libsystem_platform.dylib 0x00007ffeea226268 _sigtramp + 2571100968
6  libsystem_c.dylib        0x00007fff50c52312 abort + 127
7  libsystem_c.dylib        0x00007fff50c1a368 basename_r + 0
8  swift                    0x000000010829aa27 llvm::cast_retty<swift::GenericTypeParamType, swift::TypeBase*>::ret_type llvm::cast<swift::GenericTypeParamType, swift::TypeBase>(swift::TypeBase*) + 103
9  swift                    0x0000000108424bed swift::GenericTypeParamType* swift::TypeBase::castTo<swift::GenericTypeParamType>() + 29
10 swift                    0x000000010861ebd1 swift::RequirementEnvironment::RequirementEnvironment(swift::DeclContext*, swift::GenericSignature*, swift::ProtocolDecl*, swift::ClassDecl*, swift::ProtocolConformance*) + 1537
11 swift                    0x000000010861f3cd swift::RequirementEnvironment::RequirementEnvironment(swift::DeclContext*, swift::GenericSignature*, swift::ProtocolDecl*, swift::ClassDecl*, swift::ProtocolConformance*) + 61
12 swift                    0x0000000107c5eac6 swift::matchWitness(swift::TypeChecker&, swift::ProtocolDecl*, swift::ProtocolConformance*, swift::DeclContext*, swift::ValueDecl*, swift::ValueDecl*) + 486
13 swift                    0x0000000107c5ffd7 swift::WitnessChecker::findBestWitness(swift::ValueDecl*, bool*, swift::NormalProtocolConformance*, llvm::SmallVectorImpl<swift::RequirementMatch>&, unsigned int&, unsigned int&, bool&) + 1175
14 swift                    0x0000000107c6a857 swift::ConformanceChecker::resolveWitnessViaLookup(swift::ValueDecl*) + 1255
15 swift                    0x0000000107c6450e swift::ConformanceChecker::checkConformance(swift::MissingWitnessDiagnosisKind) + 878
16 swift                    0x0000000107c62754 swift::MultiConformanceChecker::checkIndividualConformance(swift::NormalProtocolConformance*, bool) + 3076
17 swift                    0x0000000107c617da swift::MultiConformanceChecker::checkAllConformances() + 378
18 swift                    0x0000000107c70af3 swift::TypeChecker::checkConformancesInContext(swift::DeclContext*, swift::IterableDeclContext*) + 4083
19 swift                    0x0000000107bf0497 (anonymous namespace)::DeclChecker::visitExtensionDecl(swift::ExtensionDecl*) + 1575
20 swift                    0x0000000107be6e9c swift::ASTVisitor<(anonymous namespace)::DeclChecker, void, void, void, void, void, void>::visit(swift::Decl*) + 1292
21 swift                    0x0000000107bc7897 (anonymous namespace)::DeclChecker::visit(swift::Decl*) + 391
22 swift                    0x0000000107bc76ae swift::TypeChecker::typeCheckDecl(swift::Decl*, bool) + 142
23 swift                    0x0000000107d8519c swift::performTypeChecking(swift::SourceFile&, swift::TopLevelContext&, swift::OptionSet<swift::TypeCheckingFlags, unsigned int>, unsigned int, unsigned int, unsigned int, unsigned int) + 1468
24 swift                    0x00000001073f150e swift::CompilerInstance::parseAndTypeCheckMainFile(swift::PersistentParserState&, swift::DelayedParsingCallbacks*, swift::OptionSet<swift::TypeCheckingFlags, unsigned int>) + 926
25 swift                    0x00000001073ed4a9 swift::CompilerInstance::parseAndCheckTypes(swift::CompilerInstance::ImplicitImports const&) + 697
26 swift                    0x00000001073ecc59 swift::CompilerInstance::performSema() + 1833
27 swift                    0x0000000105ab48fe performCompile(swift::CompilerInstance&, swift::CompilerInvocation&, llvm::ArrayRef<char const*>, int&, swift::FrontendObserver*, swift::UnifiedStatsReporter*) + 4862
28 swift                    0x0000000105ab1e3e swift::performFrontend(llvm::ArrayRef<char const*>, char const*, void*, swift::FrontendObserver*) + 7406
29 swift                    0x00000001059d8532 main + 4834
30 libdyld.dylib            0x00007fff50ba6115 start + 1
Stack dump:
0.  Program arguments: ...
1.  While type-checking extension of Foo<Int> at rdar37291254.swift:5:1
@huonw
Copy link
Mannequin Author

huonw mannequin commented Feb 13, 2018

@swift-ci create

@huonw
Copy link
Mannequin Author

huonw mannequin commented Feb 13, 2018

#14588

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
@AnthonyLatsis AnthonyLatsis added the crash Bug: A crash, i.e., an abnormal termination of software label Dec 12, 2022
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
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
Projects
None yet
Development

No branches or pull requests

1 participant