mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Use the correct source file. Previously, the location of declaration macros were sent to executable plugins as if the were in the source file of the attribute. This was problematic when the attribute is synsthesized by a macro. When source location were used in the plugin, for example, as a diagnostic location, it ended up with an unknown location.
16 lines
583 B
Swift
16 lines
583 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
|
|
// RUN: %target-swift-frontend %s -swift-version 5 -module-name main -disable-availability-checking -typecheck -verify -external-plugin-path %swift-plugin-dir#%swift-plugin-server
|
|
|
|
@DebugDescription
|
|
struct MyStruct {
|
|
var flag: Bool
|
|
|
|
// expected-error @+1 {{body must consist of a single string literal}}
|
|
var debugDescription: String {
|
|
flag ? "yes" : "no"
|
|
}
|
|
}
|