Skip to content

Commit 9b1beb9

Browse files
committed
ArrayIndexError, style
1 parent fc3580e commit 9b1beb9

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

spec/arrays.dd

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -724,9 +724,9 @@ $(H2 $(LNAME2 bounds, Array Bounds Checking))
724724

725725
$(P It is an error to index an array with an index that is less than
726726
0 or greater than or equal to the array length. If an index is
727-
out of bounds, a `RangeError` exception is
728-
raised if detected at runtime, and an error if detected at compile
729-
time. A program may not rely on array bounds checking happening, for
727+
out of bounds, an `ArrayIndexError` is thrown
728+
if detected at runtime, and an error is raised if detected at compile
729+
time. A program may not rely on array bounds checking happening, for
730730
example, the following program is incorrect:
731731
)
732732

@@ -741,7 +741,7 @@ try
741741
array[i] = 5;
742742
}
743743
}
744-
catch (RangeError)
744+
catch (ArrayIndexError)
745745
{
746746
// terminate loop
747747
}

spec/expression.dd

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1580,7 +1580,7 @@ $(GNAME ArrayLiteral):
15801580
bar(arr[1 .. 3]);
15811581
assert(arr == [1, 4, 5]);
15821582

1583-
//foo(arr[0..3]); // cannot match length
1583+
//foo(arr[0 .. 3]); // cannot match length
15841584
}
15851585
-------------
15861586
)
@@ -1660,7 +1660,7 @@ $(GNAME ValueExpression):
16601660
anything.)
16611661

16621662
---
1663-
[21u:"he", 38:"ho", 2:"hi"]; // type is string[uint],
1663+
[21u: "he", 38: "ho", 2: "hi"]; // type is string[uint],
16641664
// with keys 21u, 38u and 2u
16651665
// and values "he", "ho", and "hi"
16661666
---

spec/hash-map.dd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ $(H2 $(LNAME2 literals, Literals))
3535

3636
$(SPEC_RUNNABLE_EXAMPLE_RUN
3737
---
38-
auto aa = [21u:"he", 38:"ho", 2:"hi"];
38+
auto aa = [21u: "he", 38: "ho", 2: "hi"];
3939
static assert(is(typeof(aa) == string[uint]));
4040
assert(aa[2] == "hi");
4141
---

0 commit comments

Comments
 (0)