-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added ??? and NotImplementedError because this ...
Added ??? and NotImplementedError because this seemed to be the opinion of the majority on the "Adding ??? to Predef?" thread on scala-internals. No review.
- Loading branch information
Showing
2 changed files
with
24 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
/* __ *\ | ||
** ________ ___ / / ___ Scala API ** | ||
** / __/ __// _ | / / / _ | (c) 2002-2011, LAMP/EPFL ** | ||
** __\ \/ /__/ __ |/ /__/ __ | http://scala-lang.org/ ** | ||
** /____/\___/_/ |_/____/_/ | | ** | ||
** |/ ** | ||
\* */ | ||
|
||
|
||
|
||
package scala | ||
|
||
/** Throwing this exception can be a temporary replacement for a method | ||
* body that remains to be implemented. For instance, the exception is thrown by | ||
* `Predef.???`. | ||
*/ | ||
final class NotImplementedError(msg: String) extends Error(msg) { | ||
def this() = this("an implementation is missing") | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
497e632
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wouldn't
def ???[A]:A
be better, as that would make it easier to call methods on???
, for example???[String].toLowerCase
rather than???.asInstanceOf[String].toLowerCase
.497e632
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've never had a desire to call methods on ???, and I hope I never do. What is your use case for this?
497e632
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But in any case, ???[String] is no improvement on what you can already do, (??? : String).toLowerCase.
497e632
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Didn't think of
(??? : String)
, so this would only be a marginal improvement. Use case would be that you already know parts of an implementation and just want to leave one part unimplemented. Doubt it would be used a lot.