summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPaul Phillips <paulp@improving.org>2012-04-23 11:17:41 -0700
committerPaul Phillips <paulp@improving.org>2012-04-23 13:18:41 -0700
commit9759909f12818e75fda426a6d809db92c5dc9a9e (patch)
tree77db0b2fbfa2b7dd15cf7e442a812eb5bc047dfb /src
parentf4d7febab57f7cc172abebfb3233f0ab771cd72a (diff)
downloadscala-9759909f12818e75fda426a6d809db92c5dc9a9e.tar.gz
scala-9759909f12818e75fda426a6d809db92c5dc9a9e.tar.bz2
scala-9759909f12818e75fda426a6d809db92c5dc9a9e.zip
Make scala.language vals lazy.
Otherwise loading the class reflectively runs the initializer and throws an exception.
Diffstat (limited to 'src')
-rw-r--r--src/library/scala/language.scala16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/library/scala/language.scala b/src/library/scala/language.scala
index 2837187d48..df2eb0b910 100644
--- a/src/library/scala/language.scala
+++ b/src/library/scala/language.scala
@@ -17,7 +17,7 @@ object language {
* of programs. Furthermore, dynamic member selection often relies on reflection,
* which is not available on all platforms.
*/
- implicit val dynamics: dynamics = ???
+ implicit lazy val dynamics: dynamics = ???
/** Only where enabled, postfix operator notation `(expr op)` will be allowed.
*
@@ -26,7 +26,7 @@ object language {
* _Why control it?_ Postfix operators interact poorly with semicolon inference.
* Most programmers avoid them for this reason.
*/
- implicit val postfixOps: postfixOps = ???
+ implicit lazy val postfixOps: postfixOps = ???
/** Only where enabled, accesses to members of structural types that need
* reflection are supported. Reminder: A structural type is a type of the form
@@ -42,7 +42,7 @@ object language {
* such as ProGuard have problems dealing with it. Even where reflection is available,
* reflective dispatch can lead to surprising performance degradations.
*/
- implicit val reflectiveCalls: reflectiveCalls = ???
+ implicit lazy val reflectiveCalls: reflectiveCalls = ???
/** Only where enabled, definitions of implicit conversions are allowed. An
* implicit conversion is an implicit value of unary function type `A => B`,
@@ -53,7 +53,7 @@ object language {
* implicit val conv = (s: String) => s.length
* implicit def listToX(xs: List[T])(implicit f: T => X): X = …
*
- * Implicit values of other types are not affected, and neither are implicit
+ * implicit values of other types are not affected, and neither are implicit
* classes.
*
* _Why keep the feature?_ Implicit conversions are central to many aspects
@@ -65,7 +65,7 @@ object language {
* most situations using implicit parameters leads to a better design than
* implicit conversions.
*/
- implicit val implicitConversions: implicitConversions = ???
+ implicit lazy val implicitConversions: implicitConversions = ???
/** Only where this flag is enabled, higher-kinded types can be written.
*
@@ -86,7 +86,7 @@ object language {
* enabling also serves as a warning that code involving higher-kinded types
* might have to be slightly revised in the future.
*/
- implicit val higherKinds: higherKinds = ???
+ implicit lazy val higherKinds: higherKinds = ???
/** Only where enabled, existential types that cannot be expressed as wildcard
* types can be written and are allowed in inferred types of values or return
@@ -102,7 +102,7 @@ object language {
* is generally perceived not to be a good idea. Also, complicated existential types
* might be no longer supported in a future simplification of the language.
*/
- implicit val existentials: existentials = ???
+ implicit lazy val existentials: existentials = ???
object experimental {
@@ -119,6 +119,6 @@ object language {
* _Why control it?_ For their very power, macros can lead to code that is hard
* to debug and understand.
*/
- implicit val macros: macros = ???
+ implicit lazy val macros: macros = ???
}
}