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
The end result of this is that when end-users attempt to use the functions/types defined in those conflicting files, they get a fairly confusing error message in the consuming code:
The names of your files have nothing to do with the names of the declarations in them. Having two files that differ only by case is fine as far as the compiler or package manager are concerned. If there is a bug here, it's that the contents of the files aren't being checked properly.
(In other words, this error would happen even if you named the files Foo.swift and Bar.swift.)
@belkadan Sorry, I don't follow, and that doesn't seem to be what the sample is demonstrating. In the sample, `Foo.swift` is defining `public func foo()`, while `foo.swift` is defining `public func bar()`. Renaming `foo.swift` to `Bar.swift` fixes the bug:
Additional Detail from JIRA
md5: da8f13d1a3b3ac5b00cfd629e956aa13
Issue Description:
If a package has multiple files named the same way,
swift build
will fail to compile the package and throws a helpful error:However, if the files have the same name with a different case,
swift build
fails to catch the conflict and successfully builds the package:The end result of this is that when end-users attempt to use the functions/types defined in those conflicting files, they get a fairly confusing error message in the consuming code:
I believe the simplest fix for this would be to ensure that we're using a case-insensitive compare when checking for filename conflicts.
I've uploaded a minimal case to reproduce the bug on my GitHub.
The text was updated successfully, but these errors were encountered: