Skip to content

Commit 1eed780

Browse files
committed
Remove unused code
1 parent 50b70ca commit 1eed780

File tree

3 files changed

+0
-26
lines changed

3 files changed

+0
-26
lines changed

compiler/src/dotty/tools/dotc/core/Definitions.scala

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,6 @@ class Definitions {
224224
@tu lazy val Compiletime_constValueOpt: Symbol = CompiletimePackageObject.requiredMethod("constValueOpt")
225225
@tu lazy val Compiletime_code : Symbol = CompiletimePackageObject.requiredMethod("code")
226226
@tu lazy val Compiletime_summonFrom : Symbol = CompiletimePackageObject.requiredMethod("summonFrom")
227-
@tu lazy val Compiletime_notNull : Symbol = CompiletimePackageObject.requiredMethod("$notNull")
228227
@tu lazy val CompiletimeTestingPackageObject: Symbol = ctx.requiredModule("scala.compiletime.testing.package")
229228
@tu lazy val CompiletimeTesting_typeChecks: Symbol = CompiletimeTestingPackageObject.requiredMethod("typeChecks")
230229
@tu lazy val CompiletimeTesting_typeCheckErrors: Symbol = CompiletimeTestingPackageObject.requiredMethod("typeCheckErrors")

compiler/src/dotty/tools/dotc/typer/ConstFold.scala

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -21,16 +21,6 @@ object ConstFold {
2121
/** If tree is a constant operation, replace with result. */
2222
def apply[T <: Tree](tree: T)(implicit ctx: Context): T = finish(tree) {
2323
tree match {
24-
// TODO: fix it later
25-
// case CompareNull(operand, testEqual)
26-
// if ctx.explicitNulls && !operand.typeOpt.isNullableUnion =>
27-
// println(tree.show)
28-
// Constant(!testEqual)
29-
// case CompareNull(TrackedRef(ref), testEqual)
30-
// if ctx.settings.YexplicitNulls.value && ctx.notNullInfos.impliesNotNull(ref) =>
31-
// //throw new NullPointerException()
32-
// // TODO maybe drop once we have general Nullability?
33-
// Constant(!testEqual)
3424
case Apply(Select(xt, op), yt :: Nil) =>
3525
xt.tpe.widenTermRefExpr.normalized match
3626
case ConstantType(x) =>

library/src/scala/compiletime/package.scala

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -63,19 +63,4 @@ package object compiletime {
6363
* }
6464
*/
6565
type S[N <: Int] <: Int
66-
67-
/** Strip the Null type from `x`
68-
*
69-
* ```
70-
* val x: String|Null = ???
71-
* val _: String = $notNull[String, x.type & String](x)
72-
*
73-
* var y: String|Null = ???
74-
* val _: String = $notNull[String, String](x)
75-
* ```
76-
*
77-
* Since `$notNull` is erased later, if `x.type` is a stable path,
78-
* the type of `$notNull(x)` is also a stable path.
79-
*/
80-
inline def $notNull[A, B](x: => A | Null): B = x.asInstanceOf
8166
}

0 commit comments

Comments
 (0)