Files
swift-mirror/test/Macros/DebugDescription/error_complex_implementation.swift
Dave Lee ad585b3195 [Debug] Add _DebugDescription macro (#69626)
Implementation of the DebugDescription macro pitched on the forums: 
https://forums.swift.org/t/pitch-debug-description-macro/67711. In this initial commit, 
the macro is named `_DebugDescription` to indicate it's internal use at this time, 
pending Swift Evolution.

rdar://115180949
2023-12-08 15:19:16 -08:00

15 lines
404 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
@_DebugDescription
struct MyStruct {
var flag: Bool
// expected-error @+1 {{body must consist of a single string literal}}
var debugDescription: String {
flag ? "yes" : "no"
}
}