Files
swift-mirror/test/SourceKit/Misc/rdar64304839.swift
Alex Hoppen 5d9163598a [SourceKit] Fix crash in syntax model
The end location of an attribute used to point to the next token after the attribute's content, which is the closing parenthesis in valid Swift code. But when the parenthesis is missing, it points to the next token, which is most likely no longer part of the attribute.

Fix by parsting the closing parenthesis (conditionally) first and using the location of last token parsed for the attribute (`PreviuosLoc`) as the attribute range's end location.

Resolves rdar://64304839
2021-03-19 13:12:03 +01:00

7 lines
155 B
Swift

// RUN: %sourcekitd-test -req=open %s -- %s
// Test that this doesn't crash sourcekitd
@available(macOS 10.12
@available(macOS 10.13
func foo() {} {code}