Created
December 22, 2016 01:05
-
-
Save gkossakowski/35aab3b9d049ddf3541bb1a57cb08608 to your computer and use it in GitHub Desktop.
An example of an awkward code pattern caused by interruptible completers
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
val resolvedParents = new util.ArrayList[Type]() | |
var remainingParents = tmpl.parents | |
while (remainingParents.nonEmpty) { | |
val parent = remainingParents.head | |
val resolved = resolveTypeTree(parent, lookupScope) | |
// this is awkard and highly repetitive pattern | |
resolved match { | |
case CompletedType(tpe) => resolvedParents.add(tpe) | |
case _: IncompleteDependency | NotFound => return resolved | |
} | |
remainingParents = remainingParents.tail | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment