diff options
author | Martin Odersky <odersky@gmail.com> | 2016-06-29 09:50:27 +0200 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2016-07-11 13:35:06 +0200 |
commit | 6bd7ba9ea4484ee2065dd16077cba6c26b2050d9 (patch) | |
tree | 7b13e292f072fed02e0ba9a8a431eef92f71cf57 /src/dotty/tools/dotc/core/TypeParamInfo.scala | |
parent | a23c1a476296a25566d7aa08de676a1217b243cb (diff) | |
download | dotty-6bd7ba9ea4484ee2065dd16077cba6c26b2050d9.tar.gz dotty-6bd7ba9ea4484ee2065dd16077cba6c26b2050d9.tar.bz2 dotty-6bd7ba9ea4484ee2065dd16077cba6c26b2050d9.zip |
Remove refinement encoding of hk types
Remove the code that implemented the encoding of hk types
using refinements.
Drop the notion that RefinedTypes can be type parameters. This is
no longer true under the new representation.
Also, refactoring MemberBinding -> TypeParamInfo
Diffstat (limited to 'src/dotty/tools/dotc/core/TypeParamInfo.scala')
-rw-r--r-- | src/dotty/tools/dotc/core/TypeParamInfo.scala | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/src/dotty/tools/dotc/core/TypeParamInfo.scala b/src/dotty/tools/dotc/core/TypeParamInfo.scala new file mode 100644 index 000000000..ff3c8fca7 --- /dev/null +++ b/src/dotty/tools/dotc/core/TypeParamInfo.scala @@ -0,0 +1,29 @@ +package dotty.tools.dotc.core + +import Names.Name +import Contexts.Context +import Types.{Type, TypeBounds} + +/** A common super trait of Symbol and LambdaParam. + * Used to capture the attributes of type parameters which can be implemented as either. + */ +trait TypeParamInfo { + + /** Is this the info of a type parameter? Might be wrong for symbols */ + def isTypeParam(implicit ctx: Context): Boolean + + /** The name of the type parameter */ + def paramName(implicit ctx: Context): Name + + /** The info of the type parameter */ + def paramBounds(implicit ctx: Context): TypeBounds + + /** The info of the type parameter as seen from a prefix type. + * This can be different from `memberInfo` if the binding + * is a type symbol of a class. + */ + def paramBoundsAsSeenFrom(pre: Type)(implicit ctx: Context): TypeBounds + + /** The variance of the type parameter */ + def paramVariance(implicit ctx: Context): Int +}
\ No newline at end of file |