Tanner B 🦕🧁 on Nostr: npub1srcgh…xfms4 you used to not be able to do something like this: let type: ...
npub1srcgh979ychudzrha7asxa7kvennpghghzzadmv5gcunfw5p72qs6xfms4 (npub1src…fms4) you used to not be able to do something like this:
let type: Any.Type = …
let rawRepType = type as? RawRepresentable.Type
It would yell at you because RawRepresentable has "self or associated type constraints"
Well by adding `any P`, you can now interact with those types of existentials if their constraints don't matter to you at compile time!
Published at
2024-11-08 23:03:13Event JSON
{
"id": "23e465801ea39427ec171467e06d9f290c8b506d538e007567db58ceb26f2aec",
"pubkey": "3719c7451494683f0a64f4ec18472317bd3cabec72fa32b28bc6874f98a01748",
"created_at": 1731106993,
"kind": 1,
"tags": [
[
"p",
"80f08b97c5262fc68877efbb0377d6666730a2e8b885d6ed94463934ba81f281",
"wss://relay.mostr.pub"
],
[
"p",
"878c47bd4979fad7d81d5032895a0cbd8c7b3ac35f6b75f6131bd7144293d9fa",
"wss://relay.mostr.pub"
],
[
"e",
"ce6172f0c4d14366fccd9864f0a1b7a0c581f4c5488e309ff6719c8dc6c173fc",
"wss://relay.mostr.pub",
"reply"
],
[
"proxy",
"https://mastodon.social/users/objc/statuses/113449827900985616",
"activitypub"
]
],
"content": "nostr:npub1srcgh979ychudzrha7asxa7kvennpghghzzadmv5gcunfw5p72qs6xfms4 you used to not be able to do something like this:\n\nlet type: Any.Type = …\nlet rawRepType = type as? RawRepresentable.Type\n\nIt would yell at you because RawRepresentable has \"self or associated type constraints\"\n\nWell by adding `any P`, you can now interact with those types of existentials if their constraints don't matter to you at compile time!",
"sig": "a9f4ea1ca34f5ac3619aae0919e37591977a4185b2f5c39b817a61c537312ff4165fae68b065022c399c54aa0690d510fc75ef334012e35a145a89cd0003b38a"
}