Skip to content

Instantly share code, notes, and snippets.

@gseitz
Created July 14, 2011 22:09
Show Gist options
  • Save gseitz/1083584 to your computer and use it in GitHub Desktop.
Save gseitz/1083584 to your computer and use it in GitHub Desktop.
val rhs = Apply(lensApply, lensGet :: lensSet :: Nil)
yields the correct
rhs: scalaz.Lens.apply[test.this.Foo, scala.this.Int](((t: test.this.Foo) => 3), ((t: test.this.Foo, m: scala.this.Int) => t.copy(m)))
val appliedLensType = TypeApply(REF(lensClass), REF(ccClazz) :: TypeTree(ccMember.symbol.tpe) :: Nil)
yields
appliedLensType: scalaz.this.Lens[test.this.Foo, scala.this.Int]
and when run through `localTyper typed` results in
class Lens of type scalaz.this.Lens does not take type parameters.
the symbol for the generated val in the companion object:
val lensSym = clazz.newValue(clazz.pos.focus, newTermName("schema "))
lensSym setFlag (SYNTHETIC | ACCESSOR | STABLE)
lensSym setInfo <NEED TO SET TYPE TO scalaz.Lens[Foo, Int] but only get scalaz.Lens, which is yields a type error]
compObjClass.info.decls enter lensSym
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment