-
Notifications
You must be signed in to change notification settings - Fork 10.6k
Closed
Labels
TypeResolverbugA deviation from expected or documented behavior. Also: expected but undesirable behavior.A deviation from expected or documented behavior. Also: expected but undesirable behavior.compilerThe Swift compiler itselfThe Swift compiler itselfcrashBug: A crash, i.e., an abnormal termination of softwareBug: A crash, i.e., an abnormal termination of softwaregenericsFeature: generic declarations and typesFeature: generic declarations and types
Description
Describe the bug
the following (invalid) test program crashes the compiler:
enum Selection<Element>
{
case one(Element)
case many([Element])
}
extension Selection?
{
}
$ ~/.swiftenv/versions/DEVELOPMENT-SNAPSHOT-2022-08-30-a/usr/bin/swiftc test.swift
error: compile command failed due to signal 6 (use -v to see invocation)
swift-frontend: /home/build-user/swift/lib/AST/RequirementMachine/Symbol.cpp:81: swift::rewriting::Symbol::Storage::Storage(Symbol::Kind, swift::CanType, ArrayRef<swift::rewriting::Term>): Assertion `!type->hasUnboundGenericType()' failed.
Please submit a bug report (https://swift.org/contributing/#reporting-bugs) and include the project and the crash backtrace.
Stack dump:
0. Program arguments: /home/ec2-user/.swiftenv/versions/DEVELOPMENT-SNAPSHOT-2022-08-30-a/usr/bin/swift-frontend -frontend -c -primary-file test.swift -target x86_64-unknown-linux-gnu -disable-objc-interop -color-diagnostics -new-driver-path /home/ec2-user/.swiftenv/versions/DEVELOPMENT-SNAPSHOT-2022-08-30-a/usr/bin/swift-driver -empty-abi-descriptor -resource-dir /home/ec2-user/.swiftenv/versions/DEVELOPMENT-SNAPSHOT-2022-08-30-a/usr/lib/swift -module-name test -o /tmp/TemporaryDirectory.GFWOdM/test-1.o
1. Swift version 5.8-dev (LLVM 57827dcce6fa0fb, Swift 04f1cde82e1d1f3)
2. Compiling with the current language version
3. While evaluating request TypeCheckSourceFileRequest(source_file "test.swift")
4. While type-checking extension of Selection? (at test.swift:6:1)
5. While evaluating request GenericSignatureRequest(extension of Selection?)
6. While evaluating request InferredGenericSignatureRequest(<Wrapped>, (null), extension of Selection?, {Wrapped == Selection}, {}, 1)
Steps To Reproduce
Steps to reproduce the behavior:
swiftc
the given test program, on a recent nightly (i reproduced the crash onDEVELOPMENT-SNAPSHOT-2022-08-18-a
andDEVELOPMENT-SNAPSHOT-2022-08-30-a
.)
Expected behavior
the compiler should not crash
Environment (please fill out the following information)
- OS: amazon linux 2
- swift:
DEVELOPMENT-SNAPSHOT-2022-08-30-a
Metadata
Metadata
Assignees
Labels
TypeResolverbugA deviation from expected or documented behavior. Also: expected but undesirable behavior.A deviation from expected or documented behavior. Also: expected but undesirable behavior.compilerThe Swift compiler itselfThe Swift compiler itselfcrashBug: A crash, i.e., an abnormal termination of softwareBug: A crash, i.e., an abnormal termination of softwaregenericsFeature: generic declarations and typesFeature: generic declarations and types