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-3808] SILGen crash with single defaulted generic argument #46393

Closed
belkadan opened this issue Jan 31, 2017 · 2 comments
Closed

[SR-3808] SILGen crash with single defaulted generic argument #46393

belkadan opened this issue Jan 31, 2017 · 2 comments
Assignees
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 SILGen Area → compiler: The SIL generation stage

Comments

@belkadan
Copy link
Contributor

Previous ID SR-3808
Radar None
Original Reporter @belkadan
Type Bug
Status Resolved
Resolution Done
Additional Detail from JIRA
Votes 0
Component/s Compiler
Labels Bug, CompilerCrash, SILGen
Assignee @slavapestov
Priority Medium

md5: 0b8292667b9acca6638af51718c4934d

relates to:

  • SR-3806 Type checker rejects single defaulted generic argument

Issue Description:

protocol Initializable {
  init()
}
struct Generic<T: Initializable> {
  init(_ value: T = T()) {}
}
struct InitializableImpl: Initializable {
  init() {}
}
func testInitializable() {
  // The ".init" is required to avoid SR-3806.
  _ = Generic<InitializableImpl>.init()
Assertion failed: (!ParamInfos.empty()), function claimNextParameter, file /Volumes/Data/swift-public/swift/lib/SILGen/SILGenApply.cpp, line 2961.
0  swiftc                   0x00000001088847a8 llvm::sys::PrintStackTrace(llvm::raw_ostream&) + 40
1  swiftc                   0x00000001088839c6 llvm::sys::RunSignalHandlers() + 86
2  swiftc                   0x0000000108884df9 SignalHandler(int) + 361
3  libsystem_platform.dylib 0x000000010b4f4fba _sigtramp + 26
4  libsystem_platform.dylib 0x0000ffff00001fa0 _sigtramp + 4105228288
5  libsystem_c.dylib        0x000000010b27bf8b abort + 127
6  libsystem_c.dylib        0x000000010b2446e6 basename_r + 0
7  swiftc                   0x0000000105eb1bfa (anonymous namespace)::ArgEmitter::emit(swift::Lowering::ArgumentSource&&, swift::Lowering::AbstractionPattern) + 5370
8  swiftc                   0x0000000105eb3ad2 (anonymous namespace)::ArgEmitter::emitShuffle(swift::Expr*, swift::Expr*, llvm::ArrayRef<swift::TupleTypeElt>, swift::ConcreteDeclRef, llvm::ArrayRef<swift::Expr*>, llvm::ArrayRef<int>, llvm::ArrayRef<unsigned int>, swift::Type, swift::Lowering::AbstractionPattern) + 4354
9  swiftc                   0x0000000105eb2865 (anonymous namespace)::ArgEmitter::emitExpanded(swift::Lowering::ArgumentSource&&, swift::Lowering::AbstractionPattern) + 2197
10 swiftc                   0x0000000105eb082f (anonymous namespace)::ArgEmitter::emit(swift::Lowering::ArgumentSource&&, swift::Lowering::AbstractionPattern) + 303
11 swiftc                   0x0000000105eafe84 (anonymous namespace)::CallSite::emit(swift::Lowering::SILGenFunction&, swift::Lowering::AbstractionPattern, (anonymous namespace)::ParamLowering&, llvm::SmallVectorImpl<swift::Lowering::ManagedValue>&, llvm::SmallVectorImpl<std::__1::pair<swift::Lowering::LValue, swift::SILLocation> >&, llvm::Optional<swift::ForeignErrorConvention> const&, swift::ImportAsMemberStatus const&) && + 452
12 swiftc                   0x0000000105e9c747 (anonymous namespace)::CallEmission::apply(swift::Lowering::SGFContext) + 5863
13 swiftc                   0x0000000105e9ab43 swift::Lowering::SILGenFunction::emitApplyExpr(swift::Expr*, swift::Lowering::SGFContext) + 51
@belkadan
Copy link
Contributor Author

(not a regression from 3.0)

@slavapestov
Copy link
Member

Jordan merged this ages ago: #7169

@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 SILGen Area → compiler: The SIL generation stage
Projects
None yet
Development

No branches or pull requests

3 participants