Skip to content

Commit

Permalink
Type the hash keys
Browse files Browse the repository at this point in the history
  • Loading branch information
MasterDuke17 committed Apr 4, 2024
1 parent 05aae71 commit 23a9fdb
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions src/vm/jvm/runtime/org/raku/rakudo/Binder.java
Original file line number Diff line number Diff line change
Expand Up @@ -972,9 +972,9 @@ public static int bind(ThreadContext tc, RakOps.GlobalExt gcx, CallFrame cf, Six
* to work on. We'll delete stuff from it as we bind, and what we have
* left over can become the slurpy hash or - if we aren't meant to be
* taking one - tell us we have a problem. */
Object2IntOpenHashMap namedArgsCopy = csd.nameMap == null
Object2IntOpenHashMap<String> namedArgsCopy = csd.nameMap == null
? null
: new Object2IntOpenHashMap(csd.nameMap);
: new Object2IntOpenHashMap<String>(csd.nameMap);

/* Now we'll walk through the signature and go about binding things. */
int numPosArgs = csd.numPositionals;
Expand Down Expand Up @@ -1190,16 +1190,14 @@ else if (!suppressArityFail) {
if (error != null) {
int numExtra = namedArgsCopy.size();
if (numExtra == 1) {
for (Object n : namedArgsCopy.keySet()) {
String name = (String)n;
for (String name : namedArgsCopy.keySet()) {
error[0] = "Unexpected named argument '" + name + "' passed";
}
}
else {
boolean first = true;
error[0] = numExtra + " unexpected named arguments passed (";
for (Object n : namedArgsCopy.keySet()) {
String name = (String)n;
for (String name : namedArgsCopy.keySet()) {
if (!first)
error[0] += ", ";
else
Expand All @@ -1217,13 +1215,12 @@ else if (!suppressArityFail) {
}

/* Takes any nameds we didn't capture yet and makes a VM Hash of them. */
private static SixModelObject vmHashOfRemainingNameds(ThreadContext tc, RakOps.GlobalExt gcx, Object2IntOpenHashMap namedArgsCopy, Object[] args) {
private static SixModelObject vmHashOfRemainingNameds(ThreadContext tc, RakOps.GlobalExt gcx, Object2IntOpenHashMap<String> namedArgsCopy, Object[] args) {
SixModelObject slurpy = gcx.Mu;
if (namedArgsCopy != null) {
SixModelObject BOOTHash = tc.gc.BOOTHash;
slurpy = BOOTHash.st.REPR.allocate(tc, BOOTHash.st);
for (Object n : namedArgsCopy.keySet()) {
String name = (String)n;
for (String name : namedArgsCopy.keySet()) {
int lookup = namedArgsCopy.getInt(name);
switch (lookup & 7) {
case CallSiteDescriptor.ARG_OBJ:
Expand Down

0 comments on commit 23a9fdb

Please sign in to comment.