Allow nil to be passed to optional type-specific arguments, making them return their default value.

For #2232.
This commit is contained in:
Vexatos 2017-01-22 15:11:48 +01:00
parent 5c76be7fc5
commit ce304ea248

View File

@ -196,7 +196,7 @@ class ArgumentsImpl(val args: Seq[AnyRef]) extends Arguments {
case value => value
}.toArray
private def isDefined(index: Int) = index >= 0 && index < args.length
private def isDefined(index: Int) = index >= 0 && index < args.length && args(index) != null
private def checkIndex(index: Int, name: String) =
if (index < 0) throw new IndexOutOfBoundsException()