[swift-dev] Generic Subscripting

Stephen Celis stephen.celis at gmail.com
Wed Mar 2 20:17:03 CST 2016

Hello, swift-dev!

I started diving into the Swift code base in December to see if I could wire together generic subscripts (https://bugs.swift.org/browse/SR-115), but I didn't have the time or know-how to get very far. I jumped back in again this past week and some of my earlier work was made obsolete by Chris's DeclContext plumbing at the end of last year :)

Michael Ilseman (cc'd) also started working on this but I don't think he had time to get much farther.

Last weekend I rebased, updated my code, and pushed a branch that seems to satisfy the general lexer:


I am, however, having a bit of trouble finding my way around the type checker and constraint generator. Trying to compile a simple example fails with this assertion: https://gist.github.com/stephencelis/10f9210a5409ee9bd79b

I know that I need to handle the generic type earlier, but I'm not sure where and I'm not sure where function decls are similarly handled.

I might be biting off more than I can chew, and it's possible that I should dive into some smaller, starter issues to get my feet wet to more gradually understand the code base. If you have the time, though, I'd be grateful for a little push in the right direction!


More information about the swift-dev mailing list