Closed iwheelbuy closed 3 years ago
Also I got typealias __States<T> = [__State[T]> where T: Hashable
from typealias __States<T> = Array<__State<T>> where T: Hashable
and OptionalInt?>.none
from Optional<Optional<Int>>.none
Also I got
typealias __States<T> = [__State[T]> where T: Hashable
fromtypealias __States<T> = Array<__State<T>> where T: Hashable
andOptionalInt?>.none
fromOptional<Optional<Int>>.none
This is probably a different rule/bug. Can you please open a new issue for it?
This seems to be caused by a SourceKit issue:
public func with(`default`: Bool? = nil) -> UserAddress {
return UserAddress(`default`: `default` ?? self.`default`)
}
{
"key.diagnostic_stage" : "source.diagnostic.stage.swift.parse",
"key.diagnostics" : [
{
"key.column" : 21,
"key.description" : "keyword 'default' does not need to be escaped in argument list",
"key.diagnostic_stage" : "source.diagnostic.stage.swift.parse",
"key.filepath" : "\/Users\/marcelofabri\/projetos\/SwiftLint\/file.swift",
"key.fixits" : [
{
"key.length" : 1,
"key.offset" : 78,
"key.sourcetext" : ""
},
{
"key.length" : 1,
"key.offset" : 86,
"key.sourcetext" : ""
}
],
"key.line" : 2,
"key.severity" : "source.diagnostic.severity.warning"
}
],
"key.length" : 120,
"key.offset" : 0,
"key.substructure" : [
{
"key.accessibility" : "source.lang.swift.accessibility.public",
"key.attributes" : [
{
"key.attribute" : "source.decl.attribute.public",
"key.length" : 6,
"key.offset" : 0
}
],
"key.bodylength" : 61,
"key.bodyoffset" : 57,
"key.kind" : "source.lang.swift.decl.function.free",
"key.length" : 112,
"key.name" : "with(default:)",
"key.namelength" : 28,
"key.nameoffset" : 12,
"key.offset" : 7,
"key.substructure" : [
{
"key.kind" : "source.lang.swift.decl.var.parameter",
"key.length" : 22,
"key.name" : "default",
"key.namelength" : 7,
"key.nameoffset" : 17,
"key.offset" : 17,
"key.typename" : "Bool?"
},
{
"key.bodylength" : 38,
"key.bodyoffset" : 78,
"key.kind" : "source.lang.swift.expr.call",
"key.length" : 51,
"key.name" : "UserAddress",
"key.namelength" : 11,
"key.nameoffset" : 66,
"key.offset" : 66,
"key.substructure" : [
{
"key.bodylength" : 27,
"key.bodyoffset" : 89,
"key.kind" : "source.lang.swift.expr.argument",
"key.length" : 38,
"key.name" : "`defaul", // Wrong!
"key.namelength" : 7, // Wrong!
"key.nameoffset" : 78,
"key.offset" : 78
}
]
}
],
"key.typename" : "UserAddress"
}
]
}
Created SR-11987 to track this.
This issue has been automatically marked as stale because it has not had any recent activity. Please comment to prevent this issue from being closed. Thank you for your contributions!
Still an issue on Swift 5.3
It'd be helpful if others weighed in on SR-11987 so the Swift team can be made aware of this issue.
This issue has been automatically marked as stale because it has not had any recent activity. Please comment to prevent this issue from being closed. Thank you for your contributions!
New Issue Checklist
Describe the bug
I have some swift code which is autogenerated. It contains
Xcode suggests:
I'd love to replace it, but since the file is autogenerated it will become
`default`
very soon. But the SwiftLink autocorrects the file in a wrong way and I getComplete output when running SwiftLint, including the stack trace and command used
Environment