Files
swift-mirror/test/Macros/DebugDescription/error_computed_properties.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

13 lines
401 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 name: String { "thirty" }
// expected-error @+1 {{cannot reference computed properties}}
var debugDescription: String { "name: \(name)" }
}