[SR-12934] How can I forward #filePath for Swift 5.2 & 5.3 without just silencing the warning #55380
Labels
bug
A deviation from expected or documented behavior. Also: expected but undesirable behavior.
Attachment: Download
Environment
today's snapshot
Swift version 5.3-dev (LLVM 5b8bad5c6b, Swift d992e04717)
Additional Detail from JIRA
md5: b8e8326821df35d900d7831aa50a46da
Issue Description:
Let's assume I have a method today that is
One way to make this work for Swift 5.2 & 5.3 is this
but that means duplicating the whole method body which is usually unacceptable.
A cute hack is to do something like
but this doesn't seem to work reliably.
I've written the attached program (attention, it's a multiple modules in one file Swift file that you need to run with
/path/to/swift-nio/dev/make-single-file-spm test.swift run
or you just download the attached tarball which is a SwiftPM project.For the above hack to work, this program would need to continuously print the
EXPECTED
values but it does not. The output is:So it seems that the only thing that resolves correctly is
= #file
and= #line
without any computations being allowed.The text was updated successfully, but these errors were encountered: