Skip to content

Commit

Permalink
Demonstrate inner class generic arg issue
Browse files Browse the repository at this point in the history
  • Loading branch information
ggevay committed Jun 11, 2018
1 parent e819739 commit 01ed744
Show file tree
Hide file tree
Showing 4 changed files with 87 additions and 4 deletions.
12 changes: 12 additions & 0 deletions embedding-from-macros/src/main/scala/test/AAA.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package test

object AAA {

def bar[A](): Unit = ???


val mirror = scala.reflect.runtime.currentMirror

val universe = mirror.universe

}
9 changes: 9 additions & 0 deletions embedding-from-macros/src/main/scala/test/Foo.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
package test

class Foo {

class Foo3[A]

class Foo4

}
5 changes: 5 additions & 0 deletions embedding-from-macros/src/main/scala/test/Foo2.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
package test

class Foo2[A] {

}
65 changes: 61 additions & 4 deletions embedding-from-macros/src/test/scala/test/TestTest.scala
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,65 @@ package test

object TestTest extends App {

val r = Test2.test(Some(123).map(_ + 1))

println(r)

// val r = Test2.test(Some(123).map(_ + 1))
//
// println(r)




// val r = Test2.test {
// implicit val x = 42
// val y = implicitly[Int]
// println(y)
// }



// val r2 = Test2.test {
// implicit val x = 42
// }

//
//
// val r2 = Test2.test {
// val x = new Foo {}
// }



// val r2 = Test2.test {
// val x = (???): Foo
// }


val r3 = Test2.test {

// These all work:

//val x: Foo2[Foo2[Int]] = ??? // works

//val x = AAA.bar[List[Int]]() // works


// val x = new Foo
// val y: x.Foo4 = ??? // works





// All the following don't work:


//val x: AAA.universe.TypeTag[Int] = ???


// val x = new Foo
// val y: x.Foo3[Int] = ???


val y: Foo#Foo3[Int] = ???
}

}

0 comments on commit 01ed744

Please sign in to comment.