Skip to content

SILGenExpr crash when using parameter pack #69945

Open
@theblixguy

Description

@theblixguy
class Thing<T> {
  var value: T
  init(_ value: T) { self.value = value }

  func combineThings<each U>(head: Thing<T>, tail: repeat Thing<each U>) {
    let _ = Thing<(T, repeat each U)>((head.value, repeat (each tail).value))
  }
}

This crashes on the latest nightly (Swift version 5.11-dev (LLVM 82306b901067e3c, Swift cabb5e109fa373f)) with:

SILGenExpr.cpp:6514: swift::Lowering::RValue swift::Lowering::SILGenFunction::emitRValue(swift::Expr *, swift::Lowering::SGFContext): Assertion `!E->getType()->hasLValueType() && "l-values must be emitted with emitLValue"' failed.

It does not crash on 5.9 though.

Metadata

Metadata

Assignees

No one assigned

    Labels

    SILGenArea → compiler: The SIL generation stageassertion failureBug → crash: An assertion failurebugA deviation from expected or documented behavior. Also: expected but undesirable behavior.classFeature → type declarations: Class declarationscompilerThe Swift compiler itselfcrashBug: A crash, i.e., an abnormal termination of softwaredeclarationsFeature: declarationsexpressionsFeature: expressionsgenericsFeature: generic declarations and typeslet & varFeature: constant and variable declarationsmember expressionsFeature → expressions: Member expressionspack expansionsFeature → expressions: Pack expansion expressionsparameter packsFeature → generics: Parameter packsregressionswift 6.0

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions