Files
swift-mirror/test/Macros/DebugDescription/error_complex_implementation.swift
Rintaro Ishizaki 921555ab38 [Macros] Fix source location for declaration syntax of attached macros
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.
2024-05-17 11:23:49 -07:00

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"
}
}