mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
621 lines
19 KiB
Plaintext
621 lines
19 KiB
Plaintext
{
|
|
key.generated_buffers: [
|
|
{
|
|
key.buffer_text: "\"c\" as Int",
|
|
key.original_location: {
|
|
key.offset: 1,
|
|
key.length: 17,
|
|
key.buffer_name: "@__swiftmacro_9MacroUser0016diagsswift_eCJAcfMX12_10_9stringifyfMf_.swift"
|
|
},
|
|
key.buffer_name: "@__swiftmacro_9MacroUser0016diagsswift_eCJAcfMX12_10_9stringifyfMf_11coerceToIntfMf_.swift"
|
|
},
|
|
{
|
|
key.buffer_text: "(#coerceToInt(\"c\"), #\"#coerceToInt(\"c\")\"#)",
|
|
key.original_location: {
|
|
key.offset: 444,
|
|
key.length: 29,
|
|
key.buffer_name: diags.swift
|
|
},
|
|
key.buffer_name: "@__swiftmacro_9MacroUser0016diagsswift_eCJAcfMX12_10_9stringifyfMf_.swift"
|
|
},
|
|
{
|
|
key.buffer_text: "\"b\" as Int",
|
|
key.original_location: {
|
|
key.offset: 416,
|
|
key.length: 17,
|
|
key.buffer_name: diags.swift
|
|
},
|
|
key.buffer_name: "@__swiftmacro_9MacroUser0016diagsswift_eCJAcfMX11_10_11coerceToIntfMf0_.swift"
|
|
},
|
|
{
|
|
key.buffer_text: "\"a\" as Int",
|
|
key.original_location: {
|
|
key.offset: 388,
|
|
key.length: 17,
|
|
key.buffer_name: diags.swift
|
|
},
|
|
key.buffer_name: "@__swiftmacro_9MacroUser0016diagsswift_eCJAcfMX10_10_11coerceToIntfMf_.swift"
|
|
},
|
|
{
|
|
key.buffer_text: "import Swift\n\nprecedencegroup MyPrecedence {\n}\n\n@attached(member) macro myMacro()\n\nextension Int {\n}\n\n@main\nstruct MyMain {\n static func main() {\n }\n}\n\ntypealias Array = Void\n\ntypealias Dictionary = Void\n\ntypealias BooleanLiteralType = Void\n\ntypealias ExtendedGraphemeClusterType = Void\n\ntypealias FloatLiteralType = Void\n\ntypealias IntegerLiteralType = Void\n\ntypealias StringLiteralType = Void\n\ntypealias UnicodeScalarType = Void\n\ntypealias _ColorLiteralType = Void\n\ntypealias _ImageLiteralType = Void\n\ntypealias _FileReferenceLiteralType = Void",
|
|
key.original_location: {
|
|
key.offset: 499,
|
|
key.length: 0,
|
|
key.buffer_name: diags.swift
|
|
},
|
|
key.buffer_name: "@__swiftmacro_9MacroUser3Bad7InvalidfMp_.swift"
|
|
},
|
|
{
|
|
key.buffer_text: "func foo() {\n var x = 0\n _ = x\n}",
|
|
key.original_location: {
|
|
key.offset: 748,
|
|
key.length: 0,
|
|
key.buffer_name: diags.swift
|
|
},
|
|
key.buffer_name: "@__swiftmacro_9MacroUser1S18addMemberWithFixItfMm_.swift"
|
|
}
|
|
],
|
|
key.diagnostics: [
|
|
{
|
|
key.line: 1,
|
|
key.column: 1,
|
|
key.filepath: "@__swiftmacro_9MacroUser0016diagsswift_eCJAcfMX12_10_9stringifyfMf_11coerceToIntfMf_.swift",
|
|
key.severity: source.diagnostic.severity.error,
|
|
key.id: "cannot_convert_coerce",
|
|
key.description: "cannot convert value of type 'String' to type 'Int' in coercion",
|
|
key.ranges: [
|
|
{
|
|
key.offset: 0,
|
|
key.length: 3
|
|
}
|
|
],
|
|
key.diagnostics: [
|
|
{
|
|
key.line: 1,
|
|
key.column: 2,
|
|
key.filepath: "@__swiftmacro_9MacroUser0016diagsswift_eCJAcfMX12_10_9stringifyfMf_.swift",
|
|
key.severity: source.diagnostic.severity.note,
|
|
key.id: "in_macro_expansion",
|
|
key.description: "in expansion of macro 'coerceToInt' here",
|
|
key.ranges: [
|
|
{
|
|
key.offset: 1,
|
|
key.length: 17
|
|
}
|
|
]
|
|
},
|
|
{
|
|
key.line: 13,
|
|
key.column: 11,
|
|
key.filepath: diags.swift,
|
|
key.severity: source.diagnostic.severity.note,
|
|
key.id: "in_macro_expansion",
|
|
key.description: "in expansion of macro 'stringify' here",
|
|
key.ranges: [
|
|
{
|
|
key.offset: 444,
|
|
key.length: 29
|
|
}
|
|
]
|
|
}
|
|
]
|
|
},
|
|
{
|
|
key.line: 1,
|
|
key.column: 1,
|
|
key.filepath: "@__swiftmacro_9MacroUser0016diagsswift_eCJAcfMX11_10_11coerceToIntfMf0_.swift",
|
|
key.severity: source.diagnostic.severity.error,
|
|
key.id: "cannot_convert_coerce",
|
|
key.description: "cannot convert value of type 'String' to type 'Int' in coercion",
|
|
key.ranges: [
|
|
{
|
|
key.offset: 0,
|
|
key.length: 3
|
|
}
|
|
],
|
|
key.diagnostics: [
|
|
{
|
|
key.line: 12,
|
|
key.column: 11,
|
|
key.filepath: diags.swift,
|
|
key.severity: source.diagnostic.severity.note,
|
|
key.id: "in_macro_expansion",
|
|
key.description: "in expansion of macro 'coerceToInt' here",
|
|
key.ranges: [
|
|
{
|
|
key.offset: 416,
|
|
key.length: 17
|
|
}
|
|
]
|
|
}
|
|
]
|
|
},
|
|
{
|
|
key.line: 1,
|
|
key.column: 1,
|
|
key.filepath: "@__swiftmacro_9MacroUser0016diagsswift_eCJAcfMX10_10_11coerceToIntfMf_.swift",
|
|
key.severity: source.diagnostic.severity.error,
|
|
key.id: "cannot_convert_coerce",
|
|
key.description: "cannot convert value of type 'String' to type 'Int' in coercion",
|
|
key.ranges: [
|
|
{
|
|
key.offset: 0,
|
|
key.length: 3
|
|
}
|
|
],
|
|
key.diagnostics: [
|
|
{
|
|
key.line: 11,
|
|
key.column: 11,
|
|
key.filepath: diags.swift,
|
|
key.severity: source.diagnostic.severity.note,
|
|
key.id: "in_macro_expansion",
|
|
key.description: "in expansion of macro 'coerceToInt' here",
|
|
key.ranges: [
|
|
{
|
|
key.offset: 388,
|
|
key.length: 17
|
|
}
|
|
]
|
|
}
|
|
]
|
|
},
|
|
{
|
|
key.line: 1,
|
|
key.column: 8,
|
|
key.filepath: "@__swiftmacro_9MacroUser3Bad7InvalidfMp_.swift",
|
|
key.severity: source.diagnostic.severity.error,
|
|
key.id: "invalid_decl_in_macro_expansion",
|
|
key.description: "macro expansion cannot introduce import",
|
|
key.diagnostics: [
|
|
{
|
|
key.line: 16,
|
|
key.column: 1,
|
|
key.filepath: diags.swift,
|
|
key.severity: source.diagnostic.severity.note,
|
|
key.id: "in_macro_expansion",
|
|
key.description: "in expansion of macro 'Invalid' on struct 'Bad' here",
|
|
key.ranges: [
|
|
{
|
|
key.offset: 477,
|
|
key.length: 22
|
|
}
|
|
]
|
|
}
|
|
]
|
|
},
|
|
{
|
|
key.line: 2,
|
|
key.column: 7,
|
|
key.filepath: "@__swiftmacro_9MacroUser1S18addMemberWithFixItfMm_.swift",
|
|
key.severity: source.diagnostic.severity.warning,
|
|
key.id: "variable_never_mutated",
|
|
key.description: "variable 'x' was never mutated; consider changing to 'let' constant",
|
|
key.diagnostics: [
|
|
{
|
|
key.line: 23,
|
|
key.column: 1,
|
|
key.filepath: diags.swift,
|
|
key.severity: source.diagnostic.severity.note,
|
|
key.id: "in_macro_expansion",
|
|
key.description: "in expansion of macro 'addMemberWithFixIt' on struct 'S' here",
|
|
key.ranges: [
|
|
{
|
|
key.offset: 718,
|
|
key.length: 31
|
|
}
|
|
]
|
|
}
|
|
]
|
|
},
|
|
{
|
|
key.line: 3,
|
|
key.column: 17,
|
|
key.filepath: "@__swiftmacro_9MacroUser3Bad7InvalidfMp_.swift",
|
|
key.severity: source.diagnostic.severity.error,
|
|
key.id: "invalid_decl_in_macro_expansion",
|
|
key.description: "macro expansion cannot introduce precedence group",
|
|
key.diagnostics: [
|
|
{
|
|
key.line: 16,
|
|
key.column: 1,
|
|
key.filepath: diags.swift,
|
|
key.severity: source.diagnostic.severity.note,
|
|
key.id: "in_macro_expansion",
|
|
key.description: "in expansion of macro 'Invalid' on struct 'Bad' here",
|
|
key.ranges: [
|
|
{
|
|
key.offset: 477,
|
|
key.length: 22
|
|
}
|
|
]
|
|
}
|
|
]
|
|
},
|
|
{
|
|
key.line: 6,
|
|
key.column: 25,
|
|
key.filepath: "@__swiftmacro_9MacroUser3Bad7InvalidfMp_.swift",
|
|
key.severity: source.diagnostic.severity.error,
|
|
key.id: "macro_must_be_defined",
|
|
key.description: "macro 'myMacro()' requires a definition",
|
|
key.diagnostics: [
|
|
{
|
|
key.line: 16,
|
|
key.column: 1,
|
|
key.filepath: diags.swift,
|
|
key.severity: source.diagnostic.severity.note,
|
|
key.id: "in_macro_expansion",
|
|
key.description: "in expansion of macro 'Invalid' on struct 'Bad' here",
|
|
key.ranges: [
|
|
{
|
|
key.offset: 477,
|
|
key.length: 22
|
|
}
|
|
]
|
|
}
|
|
]
|
|
},
|
|
{
|
|
key.line: 6,
|
|
key.column: 25,
|
|
key.filepath: "@__swiftmacro_9MacroUser3Bad7InvalidfMp_.swift",
|
|
key.severity: source.diagnostic.severity.error,
|
|
key.id: "invalid_decl_in_macro_expansion",
|
|
key.description: "macro expansion cannot introduce macro",
|
|
key.diagnostics: [
|
|
{
|
|
key.line: 16,
|
|
key.column: 1,
|
|
key.filepath: diags.swift,
|
|
key.severity: source.diagnostic.severity.note,
|
|
key.id: "in_macro_expansion",
|
|
key.description: "in expansion of macro 'Invalid' on struct 'Bad' here",
|
|
key.ranges: [
|
|
{
|
|
key.offset: 477,
|
|
key.length: 22
|
|
}
|
|
]
|
|
}
|
|
]
|
|
},
|
|
{
|
|
key.line: 8,
|
|
key.column: 1,
|
|
key.filepath: "@__swiftmacro_9MacroUser3Bad7InvalidfMp_.swift",
|
|
key.severity: source.diagnostic.severity.error,
|
|
key.id: "invalid_decl_in_macro_expansion",
|
|
key.description: "macro expansion cannot introduce extension",
|
|
key.diagnostics: [
|
|
{
|
|
key.line: 16,
|
|
key.column: 1,
|
|
key.filepath: diags.swift,
|
|
key.severity: source.diagnostic.severity.note,
|
|
key.id: "in_macro_expansion",
|
|
key.description: "in expansion of macro 'Invalid' on struct 'Bad' here",
|
|
key.ranges: [
|
|
{
|
|
key.offset: 477,
|
|
key.length: 22
|
|
}
|
|
]
|
|
}
|
|
]
|
|
},
|
|
{
|
|
key.line: 11,
|
|
key.column: 1,
|
|
key.filepath: "@__swiftmacro_9MacroUser3Bad7InvalidfMp_.swift",
|
|
key.severity: source.diagnostic.severity.error,
|
|
key.id: "invalid_main_type_in_macro_expansion",
|
|
key.description: "macro expansion cannot introduce '@main' type",
|
|
key.diagnostics: [
|
|
{
|
|
key.line: 16,
|
|
key.column: 1,
|
|
key.filepath: diags.swift,
|
|
key.severity: source.diagnostic.severity.note,
|
|
key.id: "in_macro_expansion",
|
|
key.description: "in expansion of macro 'Invalid' on struct 'Bad' here",
|
|
key.ranges: [
|
|
{
|
|
key.offset: 477,
|
|
key.length: 22
|
|
}
|
|
]
|
|
}
|
|
]
|
|
},
|
|
{
|
|
key.line: 12,
|
|
key.column: 8,
|
|
key.filepath: "@__swiftmacro_9MacroUser3Bad7InvalidfMp_.swift",
|
|
key.severity: source.diagnostic.severity.error,
|
|
key.id: "invalid_macro_introduced_name",
|
|
key.description: "declaration name 'MyMain' is not covered by macro 'Invalid'",
|
|
key.diagnostics: [
|
|
{
|
|
key.line: 16,
|
|
key.column: 1,
|
|
key.filepath: diags.swift,
|
|
key.severity: source.diagnostic.severity.note,
|
|
key.id: "in_macro_expansion",
|
|
key.description: "in expansion of macro 'Invalid' on struct 'Bad' here",
|
|
key.ranges: [
|
|
{
|
|
key.offset: 477,
|
|
key.length: 22
|
|
}
|
|
]
|
|
}
|
|
]
|
|
},
|
|
{
|
|
key.line: 17,
|
|
key.column: 11,
|
|
key.filepath: "@__swiftmacro_9MacroUser3Bad7InvalidfMp_.swift",
|
|
key.severity: source.diagnostic.severity.error,
|
|
key.id: "invalid_macro_introduced_name",
|
|
key.description: "declaration name 'Array' is not covered by macro 'Invalid'",
|
|
key.diagnostics: [
|
|
{
|
|
key.line: 16,
|
|
key.column: 1,
|
|
key.filepath: diags.swift,
|
|
key.severity: source.diagnostic.severity.note,
|
|
key.id: "in_macro_expansion",
|
|
key.description: "in expansion of macro 'Invalid' on struct 'Bad' here",
|
|
key.ranges: [
|
|
{
|
|
key.offset: 477,
|
|
key.length: 22
|
|
}
|
|
]
|
|
}
|
|
]
|
|
},
|
|
{
|
|
key.line: 19,
|
|
key.column: 11,
|
|
key.filepath: "@__swiftmacro_9MacroUser3Bad7InvalidfMp_.swift",
|
|
key.severity: source.diagnostic.severity.error,
|
|
key.id: "invalid_macro_introduced_name",
|
|
key.description: "declaration name 'Dictionary' is not covered by macro 'Invalid'",
|
|
key.diagnostics: [
|
|
{
|
|
key.line: 16,
|
|
key.column: 1,
|
|
key.filepath: diags.swift,
|
|
key.severity: source.diagnostic.severity.note,
|
|
key.id: "in_macro_expansion",
|
|
key.description: "in expansion of macro 'Invalid' on struct 'Bad' here",
|
|
key.ranges: [
|
|
{
|
|
key.offset: 477,
|
|
key.length: 22
|
|
}
|
|
]
|
|
}
|
|
]
|
|
},
|
|
{
|
|
key.line: 21,
|
|
key.column: 11,
|
|
key.filepath: "@__swiftmacro_9MacroUser3Bad7InvalidfMp_.swift",
|
|
key.severity: source.diagnostic.severity.error,
|
|
key.id: "literal_type_in_macro_expansion",
|
|
key.description: "macro expansion cannot introduce default literal type 'BooleanLiteralType'",
|
|
key.diagnostics: [
|
|
{
|
|
key.line: 16,
|
|
key.column: 1,
|
|
key.filepath: diags.swift,
|
|
key.severity: source.diagnostic.severity.note,
|
|
key.id: "in_macro_expansion",
|
|
key.description: "in expansion of macro 'Invalid' on struct 'Bad' here",
|
|
key.ranges: [
|
|
{
|
|
key.offset: 477,
|
|
key.length: 22
|
|
}
|
|
]
|
|
}
|
|
]
|
|
},
|
|
{
|
|
key.line: 23,
|
|
key.column: 11,
|
|
key.filepath: "@__swiftmacro_9MacroUser3Bad7InvalidfMp_.swift",
|
|
key.severity: source.diagnostic.severity.error,
|
|
key.id: "literal_type_in_macro_expansion",
|
|
key.description: "macro expansion cannot introduce default literal type 'ExtendedGraphemeClusterType'",
|
|
key.diagnostics: [
|
|
{
|
|
key.line: 16,
|
|
key.column: 1,
|
|
key.filepath: diags.swift,
|
|
key.severity: source.diagnostic.severity.note,
|
|
key.id: "in_macro_expansion",
|
|
key.description: "in expansion of macro 'Invalid' on struct 'Bad' here",
|
|
key.ranges: [
|
|
{
|
|
key.offset: 477,
|
|
key.length: 22
|
|
}
|
|
]
|
|
}
|
|
]
|
|
},
|
|
{
|
|
key.line: 25,
|
|
key.column: 11,
|
|
key.filepath: "@__swiftmacro_9MacroUser3Bad7InvalidfMp_.swift",
|
|
key.severity: source.diagnostic.severity.error,
|
|
key.id: "literal_type_in_macro_expansion",
|
|
key.description: "macro expansion cannot introduce default literal type 'FloatLiteralType'",
|
|
key.diagnostics: [
|
|
{
|
|
key.line: 16,
|
|
key.column: 1,
|
|
key.filepath: diags.swift,
|
|
key.severity: source.diagnostic.severity.note,
|
|
key.id: "in_macro_expansion",
|
|
key.description: "in expansion of macro 'Invalid' on struct 'Bad' here",
|
|
key.ranges: [
|
|
{
|
|
key.offset: 477,
|
|
key.length: 22
|
|
}
|
|
]
|
|
}
|
|
]
|
|
},
|
|
{
|
|
key.line: 27,
|
|
key.column: 11,
|
|
key.filepath: "@__swiftmacro_9MacroUser3Bad7InvalidfMp_.swift",
|
|
key.severity: source.diagnostic.severity.error,
|
|
key.id: "literal_type_in_macro_expansion",
|
|
key.description: "macro expansion cannot introduce default literal type 'IntegerLiteralType'",
|
|
key.diagnostics: [
|
|
{
|
|
key.line: 16,
|
|
key.column: 1,
|
|
key.filepath: diags.swift,
|
|
key.severity: source.diagnostic.severity.note,
|
|
key.id: "in_macro_expansion",
|
|
key.description: "in expansion of macro 'Invalid' on struct 'Bad' here",
|
|
key.ranges: [
|
|
{
|
|
key.offset: 477,
|
|
key.length: 22
|
|
}
|
|
]
|
|
}
|
|
]
|
|
},
|
|
{
|
|
key.line: 29,
|
|
key.column: 11,
|
|
key.filepath: "@__swiftmacro_9MacroUser3Bad7InvalidfMp_.swift",
|
|
key.severity: source.diagnostic.severity.error,
|
|
key.id: "literal_type_in_macro_expansion",
|
|
key.description: "macro expansion cannot introduce default literal type 'StringLiteralType'",
|
|
key.diagnostics: [
|
|
{
|
|
key.line: 16,
|
|
key.column: 1,
|
|
key.filepath: diags.swift,
|
|
key.severity: source.diagnostic.severity.note,
|
|
key.id: "in_macro_expansion",
|
|
key.description: "in expansion of macro 'Invalid' on struct 'Bad' here",
|
|
key.ranges: [
|
|
{
|
|
key.offset: 477,
|
|
key.length: 22
|
|
}
|
|
]
|
|
}
|
|
]
|
|
},
|
|
{
|
|
key.line: 31,
|
|
key.column: 11,
|
|
key.filepath: "@__swiftmacro_9MacroUser3Bad7InvalidfMp_.swift",
|
|
key.severity: source.diagnostic.severity.error,
|
|
key.id: "literal_type_in_macro_expansion",
|
|
key.description: "macro expansion cannot introduce default literal type 'UnicodeScalarType'",
|
|
key.diagnostics: [
|
|
{
|
|
key.line: 16,
|
|
key.column: 1,
|
|
key.filepath: diags.swift,
|
|
key.severity: source.diagnostic.severity.note,
|
|
key.id: "in_macro_expansion",
|
|
key.description: "in expansion of macro 'Invalid' on struct 'Bad' here",
|
|
key.ranges: [
|
|
{
|
|
key.offset: 477,
|
|
key.length: 22
|
|
}
|
|
]
|
|
}
|
|
]
|
|
},
|
|
{
|
|
key.line: 33,
|
|
key.column: 11,
|
|
key.filepath: "@__swiftmacro_9MacroUser3Bad7InvalidfMp_.swift",
|
|
key.severity: source.diagnostic.severity.error,
|
|
key.id: "literal_type_in_macro_expansion",
|
|
key.description: "macro expansion cannot introduce default literal type '_ColorLiteralType'",
|
|
key.diagnostics: [
|
|
{
|
|
key.line: 16,
|
|
key.column: 1,
|
|
key.filepath: diags.swift,
|
|
key.severity: source.diagnostic.severity.note,
|
|
key.id: "in_macro_expansion",
|
|
key.description: "in expansion of macro 'Invalid' on struct 'Bad' here",
|
|
key.ranges: [
|
|
{
|
|
key.offset: 477,
|
|
key.length: 22
|
|
}
|
|
]
|
|
}
|
|
]
|
|
},
|
|
{
|
|
key.line: 35,
|
|
key.column: 11,
|
|
key.filepath: "@__swiftmacro_9MacroUser3Bad7InvalidfMp_.swift",
|
|
key.severity: source.diagnostic.severity.error,
|
|
key.id: "literal_type_in_macro_expansion",
|
|
key.description: "macro expansion cannot introduce default literal type '_ImageLiteralType'",
|
|
key.diagnostics: [
|
|
{
|
|
key.line: 16,
|
|
key.column: 1,
|
|
key.filepath: diags.swift,
|
|
key.severity: source.diagnostic.severity.note,
|
|
key.id: "in_macro_expansion",
|
|
key.description: "in expansion of macro 'Invalid' on struct 'Bad' here",
|
|
key.ranges: [
|
|
{
|
|
key.offset: 477,
|
|
key.length: 22
|
|
}
|
|
]
|
|
}
|
|
]
|
|
},
|
|
{
|
|
key.line: 37,
|
|
key.column: 11,
|
|
key.filepath: "@__swiftmacro_9MacroUser3Bad7InvalidfMp_.swift",
|
|
key.severity: source.diagnostic.severity.error,
|
|
key.id: "literal_type_in_macro_expansion",
|
|
key.description: "macro expansion cannot introduce default literal type '_FileReferenceLiteralType'",
|
|
key.diagnostics: [
|
|
{
|
|
key.line: 16,
|
|
key.column: 1,
|
|
key.filepath: diags.swift,
|
|
key.severity: source.diagnostic.severity.note,
|
|
key.id: "in_macro_expansion",
|
|
key.description: "in expansion of macro 'Invalid' on struct 'Bad' here",
|
|
key.ranges: [
|
|
{
|
|
key.offset: 477,
|
|
key.length: 22
|
|
}
|
|
]
|
|
}
|
|
]
|
|
}
|
|
]
|
|
}
|