-
Notifications
You must be signed in to change notification settings - Fork 1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #10428 from dotty-staging/drop-scalaShadowing
Drop scala shadowing and DottyPredef
- Loading branch information
Showing
35 changed files
with
267 additions
and
84 deletions.
There are no files selected for viewing
Submodule endpoints4s
updated
from b271e1 to 43c9d9
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
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
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
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
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
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
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
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
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
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
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,3 @@ | ||
package dotty | ||
|
||
object DottyPredef |
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,3 @@ | ||
package scalaShadowing | ||
|
||
class D_u_m_m_y |
File renamed without changes.
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
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,47 @@ | ||
package scala.runtime.stdLibPatches | ||
|
||
object Predef: | ||
import compiletime.summonFrom | ||
|
||
inline def assert(inline assertion: Boolean, inline message: => Any): Unit = | ||
if !assertion then scala.runtime.Scala3RunTime.assertFailed(message) | ||
|
||
inline def assert(inline assertion: Boolean): Unit = | ||
if !assertion then scala.runtime.Scala3RunTime.assertFailed() | ||
|
||
/** | ||
* Retrieve the single value of a type with a unique inhabitant. | ||
* | ||
* @example {{{ | ||
* object Foo | ||
* val foo = valueOf[Foo.type] | ||
* // foo is Foo.type = Foo | ||
* | ||
* val bar = valueOf[23] | ||
* // bar is 23.type = 23 | ||
* }}} | ||
* @group utilities | ||
*/ | ||
inline def valueOf[T]: T = summonFrom { | ||
case ev: ValueOf[T] => ev.value | ||
} | ||
|
||
/** Summon a given value of type `T`. Usually, the argument is not passed explicitly. | ||
* | ||
* @tparam T the type of the value to be summoned | ||
* @return the given value typed as the provided type parameter | ||
*/ | ||
inline def summon[T](using x: T): x.type = x | ||
|
||
// Extension methods for working with explicit nulls | ||
|
||
/** Strips away the nullability from a value. | ||
* e.g. | ||
* val s1: String|Null = "hello" | ||
* val s: String = s1.nn | ||
* | ||
* Note that `.nn` performs a checked cast, so if invoked on a null value it'll throw an NPE. | ||
*/ | ||
extension [T](x: T | Null) inline def nn: x.type & T = | ||
scala.runtime.Scala3RunTime.nn(x) | ||
end Predef |
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,60 @@ | ||
package scala.runtime.stdLibPatches | ||
|
||
/** Scala 3 additions and replacements to the `scala.language` object. | ||
*/ | ||
object language: | ||
|
||
/** The experimental object contains features that have been recently added but have not | ||
* been thoroughly tested in production yet. | ||
* | ||
* Experimental features '''may undergo API changes''' in future releases, so production | ||
* code should not rely on them. | ||
* | ||
* Programmers are encouraged to try out experimental features and | ||
* [[http://issues.scala-lang.org report any bugs or API inconsistencies]] | ||
* they encounter so they can be improved in future releases. | ||
* | ||
* @group experimental | ||
*/ | ||
object experimental: | ||
|
||
/** Experimental support for richer dependent types */ | ||
object dependent | ||
|
||
/** Experimental support for named type arguments */ | ||
object namedTypeArguments | ||
|
||
/** Experimental support for generic number literals */ | ||
object genericNumberLiterals | ||
end experimental | ||
|
||
/** Where imported, auto-tupling is disabled */ | ||
object noAutoTupling | ||
|
||
/** Where imported, loose equality using eqAny is disabled */ | ||
object strictEquality | ||
|
||
/** Where imported, ad hoc extensions of non-open classes in other | ||
* compilation units are allowed. | ||
* | ||
* '''Why control the feature?''' Ad-hoc extensions should usually be avoided | ||
* since they typically cannot rely on an "internal" contract between a class | ||
* and its extensions. Only open classes need to specify such a contract. | ||
* Ad-hoc extensions might break for future versions of the extended class, | ||
* since the extended class is free to change its implementation without | ||
* being constrained by an internal contract. | ||
* | ||
* '''Why allow it?''' An ad-hoc extension can sometimes be necessary, | ||
* for instance when mocking a class in a testing framework, or to work | ||
* around a bug or missing feature in the original class. Nevertheless, | ||
* such extensions should be limited in scope and clearly documented. | ||
* That's why the language import is required for them. | ||
*/ | ||
object adhocExtensions | ||
|
||
/** Source version */ | ||
object `3.0-migration` | ||
object `3.0` | ||
object `3.1-migration` | ||
object `3.1` | ||
end language |
Oops, something went wrong.