This explicit type annotation on `val c: ctx.type = ctx` is the thing that I was missing in my trials. Nicely done!