Harshil Shah on Nostr: Littlest Swift pet peeve: I simply cannot declare a variable’s type separately from ...
Littlest Swift pet peeve: I simply cannot declare a variable’s type separately from the default value
🚫 var thing: SomeType = .value
✅ var thing = SomeType.value
Published at
2024-04-17 10:05:53Event JSON
{
"id": "6d2a95526dc0dca7cd838db31981d275f55fc3661da7ae85c7e18acc5c075211",
"pubkey": "288bcaa0cab2ae47270f7d12b6bdadfbab5bda6a4b0ca8e1984b5510eae912b3",
"created_at": 1713348353,
"kind": 1,
"tags": [
[
"proxy",
"https://mastodon.social/users/harshil/statuses/112285997689333265",
"activitypub"
]
],
"content": "Littlest Swift pet peeve: I simply cannot declare a variable’s type separately from the default value\n\n🚫 var thing: SomeType = .value\n✅ var thing = SomeType.value",
"sig": "abad9b0cd8efc38b799eb574860245ae7697494a57f970ccf79d669424f2f4d6830703d2d1a767120ce3086831463f6fb8a2d48dfb488c6c5de6da447b34dd9f"
}