- 05 Feb, 2020 3 commits
-
-
Eric Myhre authored
-
Eric Myhre authored
This removes all the shitty placeholder `panic("no")` calls which previously occupied this area, and gets us one step closer to being at the quality level where we can merge this into core. Also, a short template file to make it easier to stamp out the rest of these for the remaining kinds. No automation; not worth it.
-
Eric Myhre authored
They don't reduce line count, but they do make lines much shorter, and increase consistency, which are worth it. There's some very similar things already in the codegen system, though under a different name ("kindedRejectionHelper" something). I've realized the utility also exists beyond codegen. Codegen can in the future be updated to use these (and in the process, emit noticably fewer bytes of generated code). (There could be concerns about codegen output getting overly fragile and dependent on core library versions by reusing more code like this. However, I don't think that applies here: It's already going to be fragile if any of the actual error types change; being fragile if the mixins (which are *almost* entirely about those) change is effectively the same thing, it just saves a lot of output size.) I would collapse all these uninteresting methods into one line each rather than three lines each if I could... however, the golang formatter's (rather incogruous?) rule about breaking long lines in this *particular* case strikes. Turns out in this corpus, for example, the `plainInt.LookupSegment` declaration *just* crosses over the length which forces a break, even though none of its siblings do. Sigh.
-