@@ -4,7 +4,6 @@ package transform
44import core ._
55import Types ._
66import Symbols ._
7- import SymDenotations ._
87import Contexts ._
98import Flags ._
109import StdNames ._
@@ -13,7 +12,8 @@ import SymUtils._
1312/** Methods that apply to user-defined value classes */
1413object ValueClasses {
1514
16- def isDerivedValueClass (d : SymDenotation )(implicit ctx : Context ) = {
15+ def isDerivedValueClass (sym : Symbol )(implicit ctx : Context ): Boolean = {
16+ val d = sym.denot
1717 ! ctx.settings.XnoValueClasses .value &&
1818 ! d.isRefinementClass &&
1919 d.isValueClass &&
@@ -33,27 +33,27 @@ object ValueClasses {
3333 }
3434
3535 /** The member of a derived value class that unboxes it. */
36- def valueClassUnbox (d : ClassDenotation )(implicit ctx : Context ): Symbol =
36+ def valueClassUnbox (cls : ClassSymbol )(implicit ctx : Context ): Symbol =
3737 // (info.decl(nme.unbox)).orElse(...) uncomment once we accept unbox methods
38- d .classInfo.decls.find(_.is(ParamAccessor ))
38+ cls .classInfo.decls.find(_.is(ParamAccessor ))
3939
4040 /** For a value class `d`, this returns the synthetic cast from the underlying type to
4141 * ErasedValueType defined in the companion module. This method is added to the module
4242 * and further described in [[ExtensionMethods ]].
4343 */
44- def u2evt (d : ClassDenotation )(implicit ctx : Context ): Symbol =
45- d .linkedClass.info.decl(nme.U2EVT ).symbol
44+ def u2evt (cls : ClassSymbol )(implicit ctx : Context ): Symbol =
45+ cls .linkedClass.info.decl(nme.U2EVT ).symbol
4646
4747 /** For a value class `d`, this returns the synthetic cast from ErasedValueType to the
4848 * underlying type defined in the companion module. This method is added to the module
4949 * and further described in [[ExtensionMethods ]].
5050 */
51- def evt2u (d : ClassDenotation )(implicit ctx : Context ): Symbol =
52- d .linkedClass.info.decl(nme.EVT2U ).symbol
51+ def evt2u (cls : ClassSymbol )(implicit ctx : Context ): Symbol =
52+ cls .linkedClass.info.decl(nme.EVT2U ).symbol
5353
5454 /** The unboxed type that underlies a derived value class */
55- def underlyingOfValueClass (d : ClassDenotation )(implicit ctx : Context ): Type =
56- valueClassUnbox(d ).info.resultType
55+ def underlyingOfValueClass (sym : ClassSymbol )(implicit ctx : Context ): Type =
56+ valueClassUnbox(sym ).info.resultType
5757
5858 /** Whether a value class wraps itself */
5959 def isCyclic (cls : ClassSymbol )(implicit ctx : Context ): Boolean = {
0 commit comments