Skip to content

Crash in silgen due to missed / failed typecheck #77871

@asl

Description

@asl

Description

Consider the reproducer. It crashes with llvm_unreachable in SILgen:

<unknown>:0: error: fatal error encountered during compilation; please submit a bug report (https://swift.org/contributing/#reporting-bugs)
<unknown>:0: note: unsupported collection upcast kind

At the same time if the consider the almost equivalent code (second variant), then it correctly diagnoses the problem:

 6 | }
 7 | let pb = pullback(at: 1.0, of: testFunc)
 8 | print(pb(.init(1.0)) == 3.0)
   |                         `- error: cannot convert value of type 'Double' to expected argument type 'Optional<Double>.TangentVector'

Somehow the typechecker is confused in nested pullback call inside print and produces the following type-checked expression (produced via -debug-constraints):

(call_expr type="()" location=opt2.swift:9:1 range=[opt2.swift:9:1 - line:9:57] isolation_crossing="none"
  (declref_expr type="(Any..., String, String) -> ()" location=opt2.swift:9:1 range=[opt2.swift:9:1 - line:9:1] decl="Swift.(file).print(_:separator:terminator:)" function_ref=single)
  (argument_list labels="_:separator:terminator:"
    (argument
      (vararg_expansion_expr implicit type="Any..." location=opt2.swift:9:7 range=[opt2.swift:9:7 - line:9:54]
        (array_expr implicit type="Any..." location=opt2.swift:9:7 range=[opt2.swift:9:7 - line:9:54] initializer="**NULL**"
          (erasure_expr implicit type="Any" location=opt2.swift:9:51 range=[opt2.swift:9:7 - line:9:54]
            (builtin_conformance type="Bool" protocol="Copyable")
            (builtin_conformance type="Bool" protocol="Escapable")
            (binary_expr type="Bool" location=opt2.swift:9:51 range=[opt2.swift:9:7 - line:9:54] isolation_crossing="none"
              (dot_syntax_call_expr implicit type="(Double.TangentVector, Double.TangentVector) -> Bool" location=opt2.swift:9:51 range=[opt2.swift:9:51 - line:9:51] isolation_crossing="none"
                (declref_expr type="(Double.TangentVector.Type) -> (Double.TangentVector, Double.TangentVector) -> Bool" location=opt2.swift:9:51 range=[opt2.swift:9:51 - line:9:51] decl="Swift.(file).FloatingPoint extension.== [with (substitution_map generic_signature=<Self where Self : FloatingPoint> Self -> Double)]" function_ref=single)
                (argument_list implicit
                  (argument
                    (type_expr implicit type="Double.TangentVector.Type" location=opt2.swift:9:51 range=[opt2.swift:9:51 - line:9:51] typerepr="Double.TangentVector"))))
              (argument_list implicit
                (argument
                  (call_expr type="Double.TangentVector" location=opt2.swift:9:7 range=[opt2.swift:9:7 - line:9:49] isolation_crossing="none"
                    (call_expr type="(Optional<Double>.TangentVector) -> Double.TangentVector" location=opt2.swift:9:7 range=[opt2.swift:9:7 - line:9:37] isolation_crossing="none"
                      (declref_expr type="(Double, @differentiable(reverse) (Double) -> Double?) -> (Optional<Double>.TangentVector) -> Double.TangentVector" location=opt2.swift:9:7 range=[opt2.swift:9:7 - line:9:7] decl="_Differentiation.(file).pullback(at:of:) [with (substitution_map generic_signature=<T, R where T : Differentiable, R : Differentiable> T -> Double R -> Double?)]" function_ref=double)
                      (argument_list labels="at:of:"
                        (argument label="at"
                          (float_literal_expr type="Double" location=opt2.swift:9:20 range=[opt2.swift:9:20 - line:9:20] value="1.0" builtin_initializer="Swift.(file).Double extension.init(_builtinFloatLiteral:)" initializer="**NULL**" builtin_type="Builtin.FPIEEE64"))
                        (argument label="of"
                          (function_conversion_expr implicit type="@differentiable(reverse) (Double) -> Double?" location=opt2.swift:9:29 range=[opt2.swift:9:29 - line:9:29]
                            (differentiable_function implicit type="@differentiable(reverse) (Double) -> Double?" location=opt2.swift:9:29 range=[opt2.swift:9:29 - line:9:29]
                              (declref_expr type="(Double?) -> Double?" location=opt2.swift:9:29 range=[opt2.swift:9:29 - line:9:29] decl="opt2.(file)[email protected]:4:6" function_ref=unapplied))))))
                    (argument_list
                      (argument
                        (call_expr type="Optional<Double>.TangentVector" location=opt2.swift:9:40 range=[opt2.swift:9:39 - line:9:48] isolation_crossing="none"
                          (constructor_ref_call_expr type="(Double.TangentVector?) -> Optional<Double>.TangentVector" location=opt2.swift:9:40 range=[opt2.swift:9:39 - line:9:40] isolation_crossing="none"
                            (declref_expr type="(Optional<Double>.TangentVector.Type) -> (Double.TangentVector?) -> Optional<Double>.TangentVector" location=opt2.swift:9:40 range=[opt2.swift:9:40 - line:9:40] decl="_Differentiation.(file).Optional extension.TangentVector.init(_:) [with (substitution_map generic_signature=<Wrapped where Wrapped : Differentiable> Wrapped -> Double)]" function_ref=single)
                            (argument_list implicit
                              (argument
                                (type_expr implicit type="Optional<Double>.TangentVector.Type" location=opt2.swift:9:39 range=[opt2.swift:9:39 - line:9:39] typerepr="Optional<Double>.TangentVector"))))
                          (argument_list
                            (argument
                              (inject_into_optional implicit type="Double.TangentVector?" location=opt2.swift:9:45 range=[opt2.swift:9:45 - line:9:45]
                                (float_literal_expr type="Double" location=opt2.swift:9:45 range=[opt2.swift:9:45 - line:9:45] value="1.0" builtin_initializer="Swift.(file).Double extension.init(_builtinFloatLiteral:)" initializer="**NULL**" builtin_type="Builtin.FPIEEE64")))))))))
                (argument
                  (float_literal_expr type="Double" location=opt2.swift:9:54 range=[opt2.swift:9:54 - line:9:54] value="3.0" builtin_initializer="Swift.(file).Double extension.init(_builtinFloatLiteral:)" initializer="**NULL**" builtin_type="Builtin.FPIEEE64"))))))))
    (argument label="separator"
      (default_argument_expr implicit type="String" location=opt2.swift:9:6 range=[opt2.swift:9:6 - line:9:6] default_args_owner="Swift.(file).print(_:separator:terminator:)" param=1))
    (argument label="terminator"
      (default_argument_expr implicit type="String" location=opt2.swift:9:6 range=[opt2.swift:9:6 - line:9:6] default_args_owner="Swift.(file).print(_:separator:terminator:)" param=2))))

Reproduction

import _Differentiation

@differentiable(reverse)
func testFunc(_ x: Double?) -> Double? {
    x! * x! * x!
}
print(pullback(at: 1.0, of: testFunc)(.init(1.0)) == 3.0)

correctly diagnosed variant:

import _Differentiation

@differentiable(reverse)
func testFunc(_ x: Double?) -> Double? {
    x! * x! * x!
}
let pb = pullback(at: 1.0, of: testFunc)
print(pb(.init(1.0)) == 3.0)

Stack dump

Stack dump:
0.	Program arguments: /Users/asl/Projects/swift-project/build/Ninja-RelWithDebInfoAssert/swift-macosx-arm64/bin/swift-frontend -frontend -c -primary-file opt2.swift -target arm64-apple-macosx15.0 -Xllvm -aarch64-use-tbi -enable-objc-interop -sdk /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.sdk -color-diagnostics -empty-abi-descriptor -resource-dir /Users/asl/Projects/swift-project/build/Ninja-RelWithDebInfoAssert/swift-macosx-arm64/lib/swift -Xllvm -debug-only=differentiation -module-name opt2 -debug-constraints -in-process-plugin-server-path /Users/asl/Projects/swift-project/build/Ninja-RelWithDebInfoAssert/swift-macosx-arm64/lib/swift/host/libSwiftInProcPluginServer.dylib -plugin-path /Users/asl/Projects/swift-project/build/Ninja-RelWithDebInfoAssert/swift-macosx-arm64/lib/swift/host/plugins -plugin-path /Users/asl/Projects/swift-project/build/Ninja-RelWithDebInfoAssert/swift-macosx-arm64/local/lib/swift/host/plugins -target-sdk-version 15.1 -target-sdk-name macosx15.1 -external-plugin-path /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/usr/lib/swift/host/plugins#/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/usr/bin/swift-plugin-server -external-plugin-path /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/usr/local/lib/swift/host/plugins#/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/usr/bin/swift-plugin-server -o /var/folders/jm/hc1mgp813kb_9x8z1kdwvqjc0000gn/T/TemporaryDirectory.11ewBS/opt2-1.o
1.	Swift version 6.1-dev (LLVM 42f3e8ef873e24d, Swift 0c8afd34d4d9460)
2.	Compiling with effective version 5.10
3.	While evaluating request ASTLoweringRequest(Lowering AST to SIL for file "opt2.swift")
4.	While emitting reabstraction thunk in SIL function "@$sSdSgAAIegyd_SdAAIegyd_TR".
 for <<debugloc at "<compiler-generated>":0:0>>Stack dump without symbol names (ensure you have llvm-symbolizer in your PATH or set the environment var `LLVM_SYMBOLIZER_PATH` to point to it):
0  swift-frontend           0x0000000105690af4 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) + 56
1  swift-frontend           0x000000010568f244 llvm::sys::RunSignalHandlers() + 112
2  swift-frontend           0x0000000105691138 SignalHandler(int) + 292
3  libsystem_platform.dylib 0x000000019cff0184 _sigtramp + 56
4  libsystem_pthread.dylib  0x000000019cfbaf70 pthread_kill + 288
5  libsystem_c.dylib        0x000000019cec7908 abort + 128
6  swift-frontend           0x0000000100732ee4 swift::DiagnosticHelper::create(swift::CompilerInstance&, llvm::raw_pwrite_stream&, bool) + 0
7  swift-frontend           0x0000000105611144 llvm::report_fatal_error(llvm::Twine const&, bool) + 256
8  swift-frontend           0x0000000105611044 llvm::report_fatal_error(llvm::Twine const&, bool) + 0
9  swift-frontend           0x0000000100b776dc (anonymous namespace)::Transform::~Transform() + 0
10 swift-frontend           0x0000000100b8134c (anonymous namespace)::TranslateArguments::processSingle(swift::Lowering::AbstractionPattern, swift::CanType, swift::Lowering::AbstractionPattern, swift::CanType, swift::Lowering::ManagedValue, (anonymous namespace)::ParamInfo) + 800
11 swift-frontend           0x0000000100b7f834 (anonymous namespace)::ExpanderBase<(anonymous namespace)::TranslateArguments, (anonymous namespace)::ParamInfo>::expand(swift::Lowering::AbstractionPattern, swift::CanType, swift::Lowering::AbstractionPattern, swift::CanType) + 680
12 swift-frontend           0x0000000100b85aa4 (anonymous namespace)::TranslateArguments::expandParam(swift::Lowering::AbstractionPattern, swift::AnyFunctionType::CanParam, swift::Lowering::AbstractionPattern, swift::AnyFunctionType::CanParam) + 208
13 swift-frontend           0x0000000100b792b0 (anonymous namespace)::TranslateArguments::process(swift::Lowering::AbstractionPattern, swift::ArrayRefView<swift::AnyFunctionType::Param, swift::AnyFunctionType::CanParam, swift::AnyFunctionType::CanParam::getFromParam(swift::AnyFunctionType::Param const&), true>, swift::Lowering::AbstractionPattern, swift::ArrayRefView<swift::AnyFunctionType::Param, swift::AnyFunctionType::CanParam, swift::AnyFunctionType::CanParam::getFromParam(swift::AnyFunctionType::Param const&), true>, bool) + 3036
14 swift-frontend           0x0000000100b7cc54 buildThunkBody(swift::Lowering::SILGenFunction&, swift::SILLocation, swift::Lowering::AbstractionPattern, swift::CanTypeWrapper<swift::AnyFunctionType>, swift::Lowering::AbstractionPattern, swift::CanTypeWrapper<swift::AnyFunctionType>, swift::CanTypeWrapper<swift::SILFunctionType>, swift::CanType, llvm::function_ref<void (swift::Lowering::SILGenFunction&)>) + 984
15 swift-frontend           0x0000000100b7e5f0 createThunk(swift::Lowering::SILGenFunction&, swift::SILLocation, swift::Lowering::ManagedValue, swift::Lowering::AbstractionPattern, swift::CanTypeWrapper<swift::AnyFunctionType>, swift::Lowering::AbstractionPattern, swift::CanTypeWrapper<swift::AnyFunctionType>, swift::Lowering::TypeLowering const&) + 2512
16 swift-frontend           0x0000000100b7e2f0 createThunk(swift::Lowering::SILGenFunction&, swift::SILLocation, swift::Lowering::ManagedValue, swift::Lowering::AbstractionPattern, swift::CanTypeWrapper<swift::AnyFunctionType>, swift::Lowering::AbstractionPattern, swift::CanTypeWrapper<swift::AnyFunctionType>, swift::Lowering::TypeLowering const&) + 1744
17 swift-frontend           0x0000000100b76994 (anonymous namespace)::Transform::transform(swift::Lowering::ManagedValue, swift::Lowering::AbstractionPattern, swift::CanType, swift::Lowering::AbstractionPattern, swift::CanType, swift::SILType, swift::Lowering::SGFContext) + 2740
18 swift-frontend           0x0000000100b75ec0 swift::Lowering::SILGenFunction::emitTransformedValue(swift::SILLocation, swift::Lowering::ManagedValue, swift::CanType, swift::CanType, swift::Lowering::SGFContext) + 232
19 swift-frontend           0x0000000100b1cfc0 (anonymous namespace)::RValueEmitter::visitFunctionConversionExpr(swift::FunctionConversionExpr*, swift::Lowering::SGFContext) + 1352
20 swift-frontend           0x0000000100b0c630 swift::Lowering::SILGenFunction::emitRValueAsSingleValue(swift::Expr*, swift::Lowering::SGFContext) + 56
21 swift-frontend           0x0000000100af09a8 swift::Lowering::SILGenFunction::emitConvertedRValue(swift::SILLocation, swift::Lowering::Conversion const&, swift::Lowering::SGFContext, llvm::function_ref<swift::Lowering::ManagedValue (swift::Lowering::SILGenFunction&, swift::SILLocation, swift::Lowering::SGFContext)>) + 312
22 swift-frontend           0x0000000100a8af4c swift::Lowering::ArgumentSource::getConverted(swift::Lowering::SILGenFunction&, swift::Lowering::Conversion const&, swift::Lowering::SGFContext) && + 184
23 swift-frontend           0x0000000100abf548 (anonymous namespace)::ArgEmitter::emit(swift::Lowering::ArgumentSource&&, swift::Lowering::AbstractionPattern, std::__1::optional<swift::AnyFunctionType::Param>) + 3912
24 swift-frontend           0x0000000100ab1364 (anonymous namespace)::ArgEmitter::emitSingleArg(swift::Lowering::ArgumentSource&&, swift::Lowering::AbstractionPattern, std::__1::optional<swift::AnyFunctionType::Param>) + 312
25 swift-frontend           0x0000000100abe014 (anonymous namespace)::ArgEmitter::emitPreparedArgs(swift::Lowering::PreparedArguments&&, swift::Lowering::AbstractionPattern) + 192
26 swift-frontend           0x0000000100ac87d4 (anonymous namespace)::CallSite::emit(swift::Lowering::SILGenFunction&, swift::Lowering::AbstractionPattern, swift::CanTypeWrapper<swift::SILFunctionType>, (anonymous namespace)::ParamLowering&, llvm::SmallVectorImpl<swift::Lowering::ManagedValue>&, llvm::SmallVectorImpl<(anonymous namespace)::DelayedArgument>&, swift::ForeignInfo const&) && + 532
27 swift-frontend           0x0000000100ac82dc (anonymous namespace)::CallEmission::emitArgumentsForNormalApply(swift::Lowering::AbstractionPattern, swift::CanTypeWrapper<swift::SILFunctionType>, swift::ForeignInfo const&, llvm::SmallVectorImpl<swift::Lowering::ManagedValue>&, std::__1::optional<swift::SILLocation>&) + 968
28 swift-frontend           0x0000000100ab4988 (anonymous namespace)::CallEmission::apply(swift::Lowering::SGFContext) + 1784
29 swift-frontend           0x0000000100ab3048 swift::Lowering::SILGenFunction::emitApplyExpr(swift::ApplyExpr*, swift::Lowering::SGFContext) + 2044
30 swift-frontend           0x0000000100b0c630 swift::Lowering::SILGenFunction::emitRValueAsSingleValue(swift::Expr*, swift::Lowering::SGFContext) + 56
31 swift-frontend           0x0000000100ac656c (anonymous namespace)::SILGenApply::visitExpr(swift::Expr*) + 44
32 swift-frontend           0x0000000100ab2a40 swift::Lowering::SILGenFunction::emitApplyExpr(swift::ApplyExpr*, swift::Lowering::SGFContext) + 500
33 swift-frontend           0x0000000100b0c630 swift::Lowering::SILGenFunction::emitRValueAsSingleValue(swift::Expr*, swift::Lowering::SGFContext) + 56
34 swift-frontend           0x0000000100abf47c (anonymous namespace)::ArgEmitter::emit(swift::Lowering::ArgumentSource&&, swift::Lowering::AbstractionPattern, std::__1::optional<swift::AnyFunctionType::Param>) + 3708
35 swift-frontend           0x0000000100ab1364 (anonymous namespace)::ArgEmitter::emitSingleArg(swift::Lowering::ArgumentSource&&, swift::Lowering::AbstractionPattern, std::__1::optional<swift::AnyFunctionType::Param>) + 312
36 swift-frontend           0x0000000100abe014 (anonymous namespace)::ArgEmitter::emitPreparedArgs(swift::Lowering::PreparedArguments&&, swift::Lowering::AbstractionPattern) + 192
37 swift-frontend           0x0000000100ac87d4 (anonymous namespace)::CallSite::emit(swift::Lowering::SILGenFunction&, swift::Lowering::AbstractionPattern, swift::CanTypeWrapper<swift::SILFunctionType>, (anonymous namespace)::ParamLowering&, llvm::SmallVectorImpl<swift::Lowering::ManagedValue>&, llvm::SmallVectorImpl<(anonymous namespace)::DelayedArgument>&, swift::ForeignInfo const&) && + 532
38 swift-frontend           0x0000000100ac82dc (anonymous namespace)::CallEmission::emitArgumentsForNormalApply(swift::Lowering::AbstractionPattern, swift::CanTypeWrapper<swift::SILFunctionType>, swift::ForeignInfo const&, llvm::SmallVectorImpl<swift::Lowering::ManagedValue>&, std::__1::optional<swift::SILLocation>&) + 968
39 swift-frontend           0x0000000100ab4988 (anonymous namespace)::CallEmission::apply(swift::Lowering::SGFContext) + 1784
40 swift-frontend           0x0000000100ab3048 swift::Lowering::SILGenFunction::emitApplyExpr(swift::ApplyExpr*, swift::Lowering::SGFContext) + 2044
41 swift-frontend           0x0000000100b0c630 swift::Lowering::SILGenFunction::emitRValueAsSingleValue(swift::Expr*, swift::Lowering::SGFContext) + 56
42 swift-frontend           0x0000000100b25d48 swift::Lowering::ManagedValue llvm::function_ref<swift::Lowering::ManagedValue (swift::Lowering::SGFContext)>::callback_fn<(anonymous namespace)::RValueEmitter::visitErasureExpr(swift::ErasureExpr*, swift::Lowering::SGFContext)::$_0>(long, swift::Lowering::SGFContext) + 68
43 swift-frontend           0x0000000100af4970 void llvm::function_ref<void (swift::SILValue)>::callback_fn<swift::Lowering::SILGenFunction::emitExistentialErasure(swift::SILLocation, swift::CanType, swift::Lowering::TypeLowering const&, swift::Lowering::TypeLowering const&, llvm::ArrayRef<swift::ProtocolConformanceRef>, swift::Lowering::SGFContext, llvm::function_ref<swift::Lowering::ManagedValue (swift::Lowering::SGFContext)>, bool)::$_3>(long, swift::SILValue) + 156
44 swift-frontend           0x0000000100ad7b64 swift::Lowering::SILGenBuilder::bufferForExpr(swift::SILLocation, swift::SILType, swift::Lowering::TypeLowering const&, swift::Lowering::SGFContext, llvm::function_ref<void (swift::SILValue)>) + 136
45 swift-frontend           0x0000000100aefc44 swift::Lowering::SILGenFunction::emitExistentialErasure(swift::SILLocation, swift::CanType, swift::Lowering::TypeLowering const&, swift::Lowering::TypeLowering const&, llvm::ArrayRef<swift::ProtocolConformanceRef>, swift::Lowering::SGFContext, llvm::function_ref<swift::Lowering::ManagedValue (swift::Lowering::SGFContext)>, bool) + 2452
46 swift-frontend           0x0000000100b1dd90 (anonymous namespace)::RValueEmitter::visitErasureExpr(swift::ErasureExpr*, swift::Lowering::SGFContext) + 392
47 swift-frontend           0x0000000100b09d90 swift::Lowering::SILGenFunction::emitExprInto(swift::Expr*, swift::Lowering::Initialization*, std::__1::optional<swift::SILLocation>) + 156
48 swift-frontend           0x0000000100a8b068 swift::Lowering::ArgumentSource::forwardInto(swift::Lowering::SILGenFunction&, swift::Lowering::Initialization*) && + 164
49 swift-frontend           0x0000000100a8b5fc swift::Lowering::ArgumentSource::forwardInto(swift::Lowering::SILGenFunction&, swift::Lowering::AbstractionPattern, swift::Lowering::Initialization*, swift::Lowering::TypeLowering const&) && + 256
50 swift-frontend           0x0000000100b233a8 (anonymous namespace)::RValueEmitter::visitCollectionExpr(swift::CollectionExpr*, swift::Lowering::SGFContext) + 1072
51 swift-frontend           0x0000000100b0c630 swift::Lowering::SILGenFunction::emitRValueAsSingleValue(swift::Expr*, swift::Lowering::SGFContext) + 56
52 swift-frontend           0x0000000100abf2c4 (anonymous namespace)::ArgEmitter::emit(swift::Lowering::ArgumentSource&&, swift::Lowering::AbstractionPattern, std::__1::optional<swift::AnyFunctionType::Param>) + 3268
53 swift-frontend           0x0000000100ab1364 (anonymous namespace)::ArgEmitter::emitSingleArg(swift::Lowering::ArgumentSource&&, swift::Lowering::AbstractionPattern, std::__1::optional<swift::AnyFunctionType::Param>) + 312
54 swift-frontend           0x0000000100abe014 (anonymous namespace)::ArgEmitter::emitPreparedArgs(swift::Lowering::PreparedArguments&&, swift::Lowering::AbstractionPattern) + 192
55 swift-frontend           0x0000000100ac87d4 (anonymous namespace)::CallSite::emit(swift::Lowering::SILGenFunction&, swift::Lowering::AbstractionPattern, swift::CanTypeWrapper<swift::SILFunctionType>, (anonymous namespace)::ParamLowering&, llvm::SmallVectorImpl<swift::Lowering::ManagedValue>&, llvm::SmallVectorImpl<(anonymous namespace)::DelayedArgument>&, swift::ForeignInfo const&) && + 532
56 swift-frontend           0x0000000100ac82dc (anonymous namespace)::CallEmission::emitArgumentsForNormalApply(swift::Lowering::AbstractionPattern, swift::CanTypeWrapper<swift::SILFunctionType>, swift::ForeignInfo const&, llvm::SmallVectorImpl<swift::Lowering::ManagedValue>&, std::__1::optional<swift::SILLocation>&) + 968
57 swift-frontend           0x0000000100ab4988 (anonymous namespace)::CallEmission::apply(swift::Lowering::SGFContext) + 1784
58 swift-frontend           0x0000000100ab3048 swift::Lowering::SILGenFunction::emitApplyExpr(swift::ApplyExpr*, swift::Lowering::SGFContext) + 2044
59 swift-frontend           0x0000000100b0cbfc swift::Lowering::SILGenFunction::emitIgnoredExpr(swift::Expr*) + 900
60 swift-frontend           0x0000000100ba2528 swift::Lowering::SILGenTopLevel::visitTopLevelCodeDecl(swift::TopLevelCodeDecl*) + 248
61 swift-frontend           0x0000000100ba0b64 swift::Lowering::SILGenTopLevel::visitSourceFile(swift::SourceFile*) + 100
62 swift-frontend           0x0000000100ba02f4 swift::Lowering::SILGenModule::emitEntryPoint(swift::SourceFile*, swift::SILFunction*) + 764
63 swift-frontend           0x0000000100ba1e58 swift::Lowering::SILGenModule::emitEntryPoint(swift::SourceFile*) + 264
64 swift-frontend           0x0000000100aa6430 swift::Lowering::SILGenModule::emitSourceFile(swift::SourceFile*) + 616
65 swift-frontend           0x0000000100aa6758 swift::ASTLoweringRequest::evaluate(swift::Evaluator&, swift::ASTLoweringDescriptor) const + 616
66 swift-frontend           0x0000000100b937e8 swift::SimpleRequest<swift::ASTLoweringRequest, std::__1::unique_ptr<swift::SILModule, std::__1::default_delete<swift::SILModule>> (swift::ASTLoweringDescriptor), (swift::RequestFlags)17>::evaluateRequest(swift::ASTLoweringRequest const&, swift::Evaluator&) + 132
67 swift-frontend           0x0000000100aaa5b8 swift::ASTLoweringRequest::OutputType swift::Evaluator::getResultUncached<swift::ASTLoweringRequest, swift::ASTLoweringRequest::OutputType swift::evaluateOrFatal<swift::ASTLoweringRequest>(swift::Evaluator&, swift::ASTLoweringRequest)::'lambda'()>(swift::ASTLoweringRequest const&, swift::ASTLoweringRequest::OutputType swift::evaluateOrFatal<swift::ASTLoweringRequest>(swift::Evaluator&, swift::ASTLoweringRequest)::'lambda'()) + 324
68 swift-frontend           0x0000000100aa6ce8 swift::performASTLowering(swift::FileUnit&, swift::Lowering::TypeConverter&, swift::SILOptions const&, swift::IRGenOptions const*) + 88
69 swift-frontend           0x000000010051b0fc swift::performCompileStepsPostSema(swift::CompilerInstance&, int&, swift::FrontendObserver*) + 404
70 swift-frontend           0x00000001005277f8 withSemanticAnalysis(swift::CompilerInstance&, swift::FrontendObserver*, llvm::function_ref<bool (swift::CompilerInstance&)>, bool) + 164
71 swift-frontend           0x000000010051cfbc performCompile(swift::CompilerInstance&, int&, swift::FrontendObserver*) + 700
72 swift-frontend           0x000000010051c6dc swift::performFrontend(llvm::ArrayRef<char const*>, char const*, void*, swift::FrontendObserver*) + 2392
73 swift-frontend           0x00000001002fe238 swift::mainEntry(int, char const**) + 3052
74 dyld                     0x000000019cc38274 start + 2840

Expected behavior

Correct diagnostics is emitted

Environment

Swift version 6.1-dev (LLVM 42f3e8ef873e24d, Swift 0c8afd3)
Target: arm64-apple-macosx15.0

Additional information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    AutoDiffbugA deviation from expected or documented behavior. Also: expected but undesirable behavior.crashBug: A crash, i.e., an abnormal termination of softwarefailed to produce diagnosticBug → internal error: Failed to produce diagnostic for expressiontype checkerArea → compiler: Semantic analysis

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions