Skip to content

Commit de1af91

Browse files
committed
Fix explicit nulls in community build
1 parent 3e2dd6e commit de1af91

File tree

5 files changed

+5
-5
lines changed

5 files changed

+5
-5
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ object NullOpsDecorator {
6464
stripped ne self
6565
}
6666

67-
/** Can the type have null value after erasure?
67+
/** Can the type has null value after erasure?
6868
*/
6969
def isNullableAfterErasure(using Context): Boolean = self match {
7070
case tp: ClassInfo => tp.cls.isNullableClassAfterErasure

tests/explicit-nulls/pos/option-transform.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ class OptionTransform {
44
*
55
* @return Some(value) if value != null, None if value == null
66
*/
7-
def[T <: AnyRef] (x: T | Null) toOption: Option[T] =
7+
extension[T <: AnyRef](x: T | Null) def toOption: Option[T] =
88
if x == null then None else Some(x)
99

1010
def test = {

tests/explicit-nulls/unsafe-common/unsafe-extensions.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
class Extensions {
2-
def (s: String).ext(ss: String): String = s + ss
2+
extension(s: String) def ext(ss: String): String = s + ss
33

44
def f = {
55
val x: String | Null = ???

0 commit comments

Comments
 (0)