Summary: It is not take effect in swift-tools-support-core UNIXPath fast init.
Description: UNIXPath in Path.swift line 562, called `self.init(string: path)`, but no return, this cause no effect with fast path.
privatestructUNIXPath: Path {
// ...// Fast pathinit(normalizingAbsolutePathpath: String) {
// ...if !mayNeedNormalization(absolute: path) {
self.init(string: path)
// no return to take effect.
}
// ...self.init(string: result)
}
}
I write demo and output like this:
structTest {
letstring: Stringinit(string1: String) {
self.string = string
}
init(string2: String) {
ifstring2 == "1" {
self.init(string1: string2 + " with if")
// return
}
self.init(string1: string2 + " without if")
}
}
print(Test(string2: "1").string) // '1 without if', which should be '1 with if' when add return.print(Test(string2: "2").string) // '2 without if'
The text was updated successfully, but these errors were encountered:
Additional Detail from JIRA
md5: f7cfd73ccf04d925250424b0e281cf7a
Issue Description:
Summary: It is not take effect in swift-tools-support-core UNIXPath fast init.
Description: UNIXPath in Path.swift line 562, called `self.init(string: path)`, but no return, this cause no effect with fast path.
I write demo and output like this:
The text was updated successfully, but these errors were encountered: