aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools/dotc/core/TypeParamInfo.scala
diff options
context:
space:
mode:
Diffstat (limited to 'src/dotty/tools/dotc/core/TypeParamInfo.scala')
-rw-r--r--src/dotty/tools/dotc/core/TypeParamInfo.scala29
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