File tree Expand file tree Collapse file tree 2 files changed +4
-8
lines changed
tests/run-with-compiler/i5941 Expand file tree Collapse file tree 2 files changed +4
-8
lines changed Original file line number Diff line number Diff line change @@ -203,10 +203,6 @@ object Prism {
203203 def impl [S : Type , A <: S : Type ](implicit refl : Reflection ): Expr [Prism [S , A ]] = {
204204 import refl ._
205205 import util ._
206- import quoted .Toolbox .Default ._
207-
208- val tpS = typeOf[S ]
209- val tpA = typeOf[A ]
210206
211207 ' {
212208 val get = (p : S ) => if (p.isInstanceOf [A ]) Some (p.asInstanceOf [A ]) else None
Original file line number Diff line number Diff line change @@ -24,10 +24,10 @@ object Test {
2424 assert(len2.get(employee2) == 5 )
2525
2626 // prism
27- // val jStr: Prism[Json, JStr] = GenPrism[Json, JStr]
28- // assert(jStr.getOption(JNum(4.5)) == None)
29- // assert(jStr.getOption(JStr("hello")) == Some(JStr("hello")))
30- // assert(jStr(JStr("world")) == JStr("world"))
27+ val jStr : Prism [Json , JStr ] = GenPrism [Json , JStr ]
28+ assert(jStr.getOption(JNum (4.5 )) == None )
29+ assert(jStr.getOption(JStr (" hello" )) == Some (JStr (" hello" )))
30+ assert(jStr(JStr (" world" )) == JStr (" world" ))
3131
3232 assert(GenIso [JStr , String ].to(JStr (" Hello" )) == " Hello" )
3333 assert(GenIso .unit[JNull .type ].to(JNull ) == 1 )
You can’t perform that action at this time.
0 commit comments