mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Demangling variadic tuples should not crash (#31988)
The TypeDecoder logic had a bug that caused crashes when it saw a tuple type with a variadic marker. Since variadic tuples aren't supported, this changes the logic to cleanly reject a tuple with a variadic marker.
This commit is contained in:
12
test/TypeDecoder/invalid_types.swift
Normal file
12
test/TypeDecoder/invalid_types.swift
Normal file
@@ -0,0 +1,12 @@
|
||||
// RUN: %empty-directory(%t)
|
||||
|
||||
// RUN: %target-build-swift -emit-executable %s -g -o %t/structural_types -emit-module
|
||||
// RUN: sed -ne '/\/\/ *DEMANGLE: /s/\/\/ *DEMANGLE: *//p' < %s > %t/input
|
||||
// RUN: %lldb-moduleimport-test %t/structural_types -type-from-mangled=%t/input | %FileCheck %s
|
||||
|
||||
|
||||
// If this were supported, it would be `(t: τ_0_0...)`
|
||||
// But tuples with a variadic 'd' marker are not actually valid Swift types, so
|
||||
// the type decoder rejects them.
|
||||
// DEMANGLE: $sx1td_t
|
||||
// CHECK: Can't resolve type of $sx1td_t
|
||||
Reference in New Issue
Block a user