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

Originator:radexpl
Number:rdar://18594933 Date Originated:
Status: Resolved:
Product: Product Version:
Classification: Reproducible:
 
Summary:
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:
Works

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

Version:
6.1 gm seed 2

Comments


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!