You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
On 3.0.2, this prints out:
From inside main.swift: #file - /Users/ylin/Swift/Bugs/file-is-empty/Sources/main.swift
From inside Test class: #file - /Users/ylin/Swift/Bugs/file-is-empty/Sources/main.swift
On 3.1-DEVELOPMENT-SNAPSHOT-2017-03-19-a, this prints out:
From inside main.swift: #file - /Users/ylin/Swift/Bugs/file-is-empty/Sources/main.swift
From inside Test class: #file -
This code prints out an empty string for the `#file` debug symbol inside the class on 3.1 snapshot, on both OSX and Ubuntu 16.04, which is contrary to its behavior on 3.0.2.
Is this compiler change intentional?
The text was updated successfully, but these errors were encountered:
As a workaround in this particular case, you could put the #file reference in another function that gets called from the `=` expression. The bug is localized to inside initializer expressions for stored properties.
Additional Detail from JIRA
md5: e313b742e7d7e12c484bcff6f2434dca
is duplicated by:
Issue Description:
Here is an example main.swift:
On 3.0.2, this prints out:
From inside main.swift: #file - /Users/ylin/Swift/Bugs/file-is-empty/Sources/main.swift
From inside Test class: #file - /Users/ylin/Swift/Bugs/file-is-empty/Sources/main.swift
On 3.1-DEVELOPMENT-SNAPSHOT-2017-03-19-a, this prints out:
From inside main.swift: #file - /Users/ylin/Swift/Bugs/file-is-empty/Sources/main.swift
From inside Test class: #file -
This code prints out an empty string for the `#file` debug symbol inside the class on 3.1 snapshot, on both OSX and Ubuntu 16.04, which is contrary to its behavior on 3.0.2.
Is this compiler change intentional?
The text was updated successfully, but these errors were encountered: