Swift compiler gets confused if '#endif' is in the last line of the file

Number:rdar://18594933 Date Originated:
Status: Resolved:
Product: Product Version:
Classification: Reproducible:
If a Swift file ends with "#endif" (haven't tried other preprocessor directives), syntax highlighting fails and the program refuses to compile.

Steps to Reproduce:
Write a Swift file with some #if ... #endif stuff. Make #endif the last line of the file.

Expected Results:

Actual Results:
Compiler throws error: "Expected #else or #endif at end of configuration block"; syntax highlighting gets confused.

6.1 gm seed 2


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!