I've never seen this compiler error before, and preliminary research suggested that it's a possible bug in the swift compiler itself.
Thankfully it tells me which file did the fault happened:
While type-checking declaration 0x7fc447c12e00 at /Users/gietal/dev/project/source/Extensions/FileManager+Extensions.swift:5:8
It doesn't tell me where in the file did it breaks, but at least I had a starting point. Luckily this file of mine is not that huge, so I'm able to brute force isolate each functions in the file and found that the culprit is a very specific function declaration.
This form of function declaration is the one that's causing the segmentation fault:
I've filed a bug to Apple regarding this, as I've found someone else had had a similar issue like this with Swift 2.2 before:
Anyway, this has been an annoying one to track. For now I will just have to workaround the issue by omitting the throws keyword and handle error thrown inside the function some other way.
I hope this post can help someone else who ran into the same issue. If this doesn't help, at least I hope this can give you some ideas into where to start isolating your code to find the offending piece of code.