Allow Array extensions with alternative syntax

Hello everyone,

currently it is only possible to extend Arrays or Dictionarys with a specific Element type like this:

extension Array where Element == Int {}

In my opinion it looks much cleaner, if we could write

extension [Int] {}

I think this shouldn't be too hard to implement, it could be converted to the old syntax at compile-time.

what are your thoughts?

1 Like

This is pure syntax sugar pitch which probably won't have much priority at the moment or someone from the community is willing to fully tackle the implementation and a review process of a proposal.

Other than that, this came up recently and in the past, so I think it's fair to say that we don't have to fragment the forums any further and simply jump into recent conversation instead. ;)

5 Likes

Oh okay I didn't see this conversation. Maybe I didn't look good enough :D

1 Like
Terms of Service

Privacy Policy

Cookie Policy