Helge Heß on Nostr: Is there a reason that #SwiftLang doesn't allow calling a generic function, say `func ...
Is there a reason that #SwiftLang doesn't allow calling a generic function, say `func x<T>() {}` using `x<Int>()` or `x<String>()` etc, but requires that artificial type parameter that is often used? (`x(type: Int.self)`).
Published at
2024-08-19 20:16:25Event JSON
{
"id": "1c0e332b0811f1b01e16350aa578b0d4e7d4171cb7b1a7d1fb4816f44d9fc983",
"pubkey": "9bddd4578b658620bdbf06f97fb8f978c08b641d1d0248a613f552d7ef7f709a",
"created_at": 1724098585,
"kind": 1,
"tags": [
[
"t",
"swiftlang"
],
[
"proxy",
"https://mastodon.social/users/helge/statuses/112990524928061361",
"activitypub"
]
],
"content": "Is there a reason that #SwiftLang doesn't allow calling a generic function, say `func x\u003cT\u003e() {}` using `x\u003cInt\u003e()` or `x\u003cString\u003e()` etc, but requires that artificial type parameter that is often used? (`x(type: Int.self)`).",
"sig": "938a88d27e9714e02338b4332aadd232fa919925ce3050e99c5cf5a1149847e9ff949f77aabf38fbb398029c0cb5bd84577b55a23bb81c094eca0cb557a46adc"
}