File tree Expand file tree Collapse file tree 2 files changed +2
-2
lines changed
_docs/reference/other-new-features
_spec/TODOreference/other-new-features Expand file tree Collapse file tree 2 files changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -63,7 +63,7 @@ We could create a type test at call site where the type test can be performed wi
6363val tt : TypeTest [Any , String ] =
6464 new TypeTest [Any , String ]:
6565 def unapply (s : Any ): Option [s.type & String ] = s match
66- case s : String => Some (s )
66+ case q : (s. type & String ) => Some (q )
6767 case _ => None
6868
6969f[AnyRef , String ](" acb" )(using tt)
Original file line number Diff line number Diff line change @@ -63,7 +63,7 @@ We could create a type test at call site where the type test can be performed wi
6363val tt : TypeTest [Any , String ] =
6464 new TypeTest [Any , String ]:
6565 def unapply (s : Any ): Option [s.type & String ] = s match
66- case s : String => Some (s )
66+ case q : (s. type & String ) => Some (q )
6767 case _ => None
6868
6969f[AnyRef , String ](" acb" )(using tt)
You can’t perform that action at this time.
0 commit comments