Skip to content

Instantly share code, notes, and snippets.

@gkossakowski
Created September 22, 2011 14:49
Show Gist options
  • Save gkossakowski/1234963 to your computer and use it in GitHub Desktop.
Save gkossakowski/1234963 to your computer and use it in GitHub Desktop.
object Test extends EmbeddedControls {
case class MyRow(args: List[(String, Any)]) extends Row[Rep]
override def __new[T](args: (String, Any)*): T = MyRow(args.toList).asInstanceOf[T]
trait Rep[x]
val foo: Rep[Row[Rep] { val xx: Int; val yy: String }] = (new Row[Rep] { val xx = 23; val yy = "y" }).asInstanceOf[Rep[Row[Rep] { val xx: Int; val yy: String }]]
}
println(Test.foo.xx)
//compiler error:
[error] /Users/grek/scala/lms-sandbox/src/Main.scala:158: value xx is not a member of Main.Test.Rep[Main.Test.Row[Main.Test.Rep]{val xx: Int; val yy: String}]
[error] println(Test.foo.xx)
[error] ^
[error] one error found
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment