Document that array constructor throws RuntimeException on negative size
This commit is contained in:
committed by
Space Team
parent
9f16daac02
commit
da8f9fbd04
@@ -35,6 +35,7 @@ class GenerateArrays(out: PrintWriter) : BuiltInsSourceGenerator(out) {
|
||||
out.println("/**")
|
||||
out.println(" * An array of ${typeLower}s. When targeting the JVM, instances of this class are represented as `$typeLower[]`.")
|
||||
out.println(" * @constructor Creates a new array of the specified [size], with all elements initialized to $defaultValue.")
|
||||
out.println(" * @throws RuntimeException if the specified [size] is negative.")
|
||||
out.println(" */")
|
||||
out.println("public class ${s}Array(size: Int) {")
|
||||
out.println(" /**")
|
||||
@@ -43,6 +44,8 @@ class GenerateArrays(out: PrintWriter) : BuiltInsSourceGenerator(out) {
|
||||
out.println(" *")
|
||||
out.println(" * The function [init] is called for each array element sequentially starting from the first one.")
|
||||
out.println(" * It should return the value for an array element given its index.")
|
||||
out.println(" *")
|
||||
out.println(" * @throws RuntimeException if the specified [size] is negative.")
|
||||
out.println(" */")
|
||||
out.println(" public inline constructor(size: Int, init: (Int) -> $s)")
|
||||
out.println()
|
||||
|
||||
Reference in New Issue
Block a user