[stdlib] Explicit visibility and return types: builtins

This commit is contained in:
Ilya Gorbunov
2023-09-19 14:24:45 +02:00
committed by Space Team
parent df190b1265
commit ab7c2f2196
15 changed files with 30 additions and 30 deletions
+1 -1
View File
@@ -27,7 +27,7 @@ class GenerateIterators(out: PrintWriter) : BuiltInsSourceGenerator(out) {
val s = kind.capitalized
out.println("/** An iterator over a sequence of values of type `$s`. */")
out.println("public abstract class ${s}Iterator : Iterator<$s> {" )
out.println(" override final fun next() = next$s()")
out.println(" final override fun next(): $s = next$s()")
out.println()
out.println(" /** Returns the next value in the sequence without boxing. */")
out.println(" public abstract fun next$s(): $s")
+1 -1
View File
@@ -106,7 +106,7 @@ public open class $progression
override fun toString(): String = ${"if (step > 0) \"\$first..\$last step \$step\" else \"\$first downTo \$last step \${-step}\""}
companion object {
public companion object {
/**
* Creates $progression within the specified bounds of a closed range.
*
+1 -1
View File
@@ -72,7 +72,7 @@ public class $range(start: $t, endInclusive: $t) : ${t}Progression(start, endInc
override fun toString(): String = $toString
companion object {
public companion object {
/** An empty range of values of type $t. */
public val EMPTY: $range = $range($emptyBounds)
}
+3 -3
View File
@@ -70,7 +70,7 @@ class UnsignedTypeGenerator(val type: UnsignedType, out: PrintWriter) : BuiltIns
out.println("@JvmInline")
out.println("public value class $className @kotlin.internal.IntrinsicConstEvaluation @PublishedApi internal constructor(@PublishedApi internal val data: $storageType) : Comparable<$className> {")
out.println()
out.println(""" companion object {
out.println(""" public companion object {
/**
* A constant holding the minimum value an instance of $className can have.
*/
@@ -599,7 +599,7 @@ public class ${elementType}Range(start: $elementType, endInclusive: $elementType
override fun toString(): String = "${'$'}first..${'$'}last"
companion object {
public companion object {
/** An empty range of values of type $elementType. */
public val EMPTY: ${elementType}Range = ${elementType}Range($elementType.MAX_VALUE, $elementType.MIN_VALUE)
}
@@ -655,7 +655,7 @@ internal constructor(
override fun toString(): String = if (step > 0) "${'$'}first..${'$'}last step ${'$'}step" else "${'$'}first downTo ${'$'}last step ${'$'}{-step}"
companion object {
public companion object {
/**
* Creates ${elementType}Progression within the specified bounds of a closed range.