This came up during a discussion today and I honestly wasn't sure if my assumptions were correct so looking for some clarity here!
What are the compile-time performance differences between the four declarations below?
(I have added how I think it works (based on reading the Type Inference document) in comments along with my doubts.)
let a = "hello, world!" // type is inferred let b = String("hello, world!") // type is inferred from String(...) and then passed to the root (the constant b) let c: String = .init("hello, world!") // type inference is not required let d: String = "hello, world!" // type inference is not required
Assumptions: type inference adds a small compile-time performance penalty
Note: I searched this forum and few other websites for related discussions, including the Swift reference, but couldn't find anything conclusive
Edit 0: Added "compile-time" to the word "performance" to avoid any confusion