summaryrefslogtreecommitdiff
path: root/src/reflect/scala/reflect/api/StandardDefinitions.scala
diff options
context:
space:
mode:
Diffstat (limited to 'src/reflect/scala/reflect/api/StandardDefinitions.scala')
-rw-r--r--src/reflect/scala/reflect/api/StandardDefinitions.scala99
1 files changed, 97 insertions, 2 deletions
diff --git a/src/reflect/scala/reflect/api/StandardDefinitions.scala b/src/reflect/scala/reflect/api/StandardDefinitions.scala
index c6f02f1a33..03f2a6b0aa 100644
--- a/src/reflect/scala/reflect/api/StandardDefinitions.scala
+++ b/src/reflect/scala/reflect/api/StandardDefinitions.scala
@@ -5,12 +5,59 @@
package scala.reflect
package api
-trait StandardDefinitions extends base.StandardDefinitions {
+/**
+ * Defines standard symbols and types.
+ */
+trait StandardDefinitions {
self: Universe =>
+ /** A value containing all standard defnitions. */
val definitions: DefinitionsApi
- trait DefinitionsApi extends DefinitionsBase {
+ /** Defines standard symbols (and types via its base trait). */
+ trait DefinitionsApi extends StandardTypes {
+ /** The class symbol of package `scala`. */
+ def ScalaPackageClass: ClassSymbol
+
+ /** The module class symbol of package `scala`. */
+ def ScalaPackage: ModuleSymbol
+
+ // top types
+ def AnyClass : ClassSymbol
+ def AnyValClass: ClassSymbol
+ def ObjectClass: ClassSymbol
+ def AnyRefClass: TypeSymbol
+
+ // bottom types
+ def NullClass : ClassSymbol
+ def NothingClass: ClassSymbol
+
+ // the scala value classes
+ def UnitClass : ClassSymbol
+ def ByteClass : ClassSymbol
+ def ShortClass : ClassSymbol
+ def CharClass : ClassSymbol
+ def IntClass : ClassSymbol
+ def LongClass : ClassSymbol
+ def FloatClass : ClassSymbol
+ def DoubleClass : ClassSymbol
+ def BooleanClass: ClassSymbol
+
+ /** The class symbol of class `String`. */
+ def StringClass : ClassSymbol
+
+ /** The class symbol of class `Class`. */
+ def ClassClass : ClassSymbol
+
+ /** The class symbol of class `Array`. */
+ def ArrayClass : ClassSymbol
+
+ /** The class symbol of class `List`. */
+ def ListClass : ClassSymbol
+
+ /** The module symbol of `scala.Predef`. */
+ def PredefModule: ModuleSymbol
+
def JavaLangPackageClass: ClassSymbol
def JavaLangPackage: ModuleSymbol
def ArrayModule: ModuleSymbol
@@ -45,4 +92,52 @@ trait StandardDefinitions extends base.StandardDefinitions {
def ScalaPrimitiveValueClasses: List[ClassSymbol]
def ScalaNumericValueClasses: List[ClassSymbol]
}
+
+ /** Defines standard types. */
+ trait StandardTypes {
+ /** The `Type` of type `Unit`. */
+ val UnitTpe: Type
+
+ /** The `Type` of primitive type `Byte`. */
+ val ByteTpe: Type
+
+ /** The `Type` of primitive type `Short`. */
+ val ShortTpe: Type
+
+ /** The `Type` of primitive type `Char`. */
+ val CharTpe: Type
+
+ /** The `Type` of primitive type `Int`. */
+ val IntTpe: Type
+
+ /** The `Type` of primitive type `Long`. */
+ val LongTpe: Type
+
+ /** The `Type` of primitive type `Float`. */
+ val FloatTpe: Type
+
+ /** The `Type` of primitive type `Double`. */
+ val DoubleTpe: Type
+
+ /** The `Type` of primitive type `Boolean`. */
+ val BooleanTpe: Type
+
+ /** The `Type` of type `Any`. */
+ val AnyTpe: Type
+
+ /** The `Type` of type `AnyVal`. */
+ val AnyValTpe: Type
+
+ /** The `Type` of type `AnyRef`. */
+ val AnyRefTpe: Type
+
+ /** The `Type` of type `Object`. */
+ val ObjectTpe: Type
+
+ /** The `Type` of type `Nothing`. */
+ val NothingTpe: Type
+
+ /** The `Type` of type `Null`. */
+ val NullTpe: Type
+ }
}