Files
swift-mirror/test/Macros/DebugDescription/error_custom_interpolation.swift
Dave Lee e57f70bd4d [Debugging] Add DebugDescriptionMacro experimental feature (#73107)
This removes the leading underscore from the macro.
2024-04-18 17:25:44 -07:00

22 lines
711 B
Swift

// REQUIRES: swift_swift_parser
// RUN: %empty-directory(%t)
// RUN: %target-swift-frontend %s -swift-version 5 -module-name main -disable-availability-checking -typecheck -verify -plugin-path %swift-plugin-dir
extension DefaultStringInterpolation {
fileprivate func appendInterpolation(custom: Int) {}
fileprivate func appendInterpolation<A, B>(_ a: A, _ b: B) {}
}
@DebugDescription
struct MyStruct1 {
// expected-error @+1 {{unsupported custom string interpolation expression}}
var debugDescription: String { "\(custom: 30)" }
}
@DebugDescription
struct MyStruct2 {
// expected-error @+1 {{unsupported custom string interpolation expression}}
var debugDescription: String { "\(30, true)" }
}