A typo in a protocol name can crash the compiler under certain conditions #73668
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
Frontend
Area → compiler: Frontend
triage needed
This issue needs more specific labels
type checker
Area → compiler: Semantic analysis
Description
I made a typo in my Vapor project model definition by mistyping
Model
and this caused a crash. I later managed to distil this crash and recreate it in a standalone repository. Here is the link: https://github.com/RussBaz/SwiftCompilerBug1. Just clone it and run a build command. The compiler will crash.Please have a look at
Sources/App/Models/Todo.swift
file. Type checking of theQueryBuilder
extension method (constrained toTodo
model) in that file crashes the compiler when theTodo
model is conforming to a non-existent protocol.Reproduction
Stack dump
Expected behavior
Only an error should be raised. The compiler should not crash.
Environment
swift-driver version: 1.90.11.1 Apple Swift version 5.10 (swiftlang-5.10.0.13 clang-1500.3.9.4)
Target: arm64-apple-macosx14.0
macOS: 14.4.1 (23E224)
Additional information
It also happens on the Intel mac.
The text was updated successfully, but these errors were encountered: