-
Notifications
You must be signed in to change notification settings - Fork 533
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1242 from joroKr21/witness-refinement-backport
Remove refinement from Witness.value
- Loading branch information
Showing
3 changed files
with
28 additions
and
1 deletion.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package shapeless | ||
|
||
import org.junit.Assert._ | ||
import org.junit.Test | ||
|
||
import scala.reflect.runtime.universe.WeakTypeTag | ||
|
||
class WitnessJvmTests { | ||
|
||
@Test | ||
def testRuntimeReflection: Unit = { | ||
val w1: Witness.Lt[Int] = Witness(1) | ||
val v1 = w1.value | ||
def infer[T](v: T)(implicit ev: WeakTypeTag[T]): WeakTypeTag[T] = ev | ||
val tag = infer(v1) | ||
assertEquals(tag.tpe.toString, "w1.T") | ||
} | ||
} |
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
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