[stdlib] Explicit visibility and return types: builtins
This commit is contained in:
committed by
Space Team
parent
df190b1265
commit
ab7c2f2196
@@ -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")
|
||||
|
||||
@@ -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.
|
||||
*
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
|
||||
@@ -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.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user