Skip to content

Commit 0964c6a

Browse files
committed
Repair Method#parameters and return no names for core methods not implemented in Ruby
1 parent b049fe0 commit 0964c6a

File tree

4 files changed

+13
-11
lines changed

4 files changed

+13
-11
lines changed

src/main/java/org/truffleruby/core/proc/RubyProc.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ public int getArityNumber() {
123123
}
124124

125125
public ArgumentDescriptor[] getArgumentDescriptors() {
126-
return argumentDescriptors == null ? arity.toAnonymousArgumentDescriptors() : argumentDescriptors;
126+
return argumentDescriptors == null ? arity.toUnnamedArgumentDescriptors() : argumentDescriptors;
127127
}
128128

129129
// region SourceLocation

src/main/java/org/truffleruby/language/methods/Arity.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -164,31 +164,31 @@ public String[] getRequiredKeywordArguments() {
164164
return requiredKeywords;
165165
}
166166

167-
public ArgumentDescriptor[] toAnonymousArgumentDescriptors() {
167+
public ArgumentDescriptor[] toUnnamedArgumentDescriptors() {
168168
List<ArgumentDescriptor> descs = new ArrayList<>();
169169

170170
for (int i = 0; i < preRequired; i++) {
171-
descs.add(new ArgumentDescriptor(ArgumentType.anonreq));
171+
descs.add(new ArgumentDescriptor(ArgumentType.unnamedreq));
172172
}
173173

174174
for (int i = 0; i < optional; i++) {
175-
descs.add(new ArgumentDescriptor(ArgumentType.anonopt));
175+
descs.add(new ArgumentDescriptor(ArgumentType.unnamedopt));
176176
}
177177

178178
if (hasRest) {
179-
descs.add(new ArgumentDescriptor(ArgumentType.anonrest));
179+
descs.add(new ArgumentDescriptor(ArgumentType.unnamedrest));
180180
}
181181

182182
for (int i = 0; i < postRequired; i++) {
183-
descs.add(new ArgumentDescriptor(ArgumentType.anonreq));
183+
descs.add(new ArgumentDescriptor(ArgumentType.unnamedreq));
184184
}
185185

186186
for (String keyword : keywordArguments) {
187187
descs.add(new ArgumentDescriptor(ArgumentType.key, keyword));
188188
}
189189

190190
if (hasKeywordsRest) {
191-
descs.add(new ArgumentDescriptor(ArgumentType.anonkeyrest));
191+
descs.add(new ArgumentDescriptor(ArgumentType.unnamedkeyrest));
192192
}
193193

194194
return descs.toArray(ArgumentDescriptor.EMPTY_ARRAY);

src/main/java/org/truffleruby/language/methods/SharedMethodInfo.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ public ArgumentDescriptor[] getRawArgumentDescriptors() {
116116
}
117117

118118
public ArgumentDescriptor[] getArgumentDescriptors() {
119-
return argumentDescriptors == null ? arity.toAnonymousArgumentDescriptors() : argumentDescriptors;
119+
return argumentDescriptors == null ? arity.toUnnamedArgumentDescriptors() : argumentDescriptors;
120120
}
121121

122122
public boolean isBlock() {

src/main/java/org/truffleruby/parser/ArgumentType.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,14 @@ public enum ArgumentType {
3636
rest("rest", false),
3737
req("req", false),
3838
anonreq("req", true),
39-
anonopt("opt", true),
4039
anonrest("rest", true),
4140
anonkeyrest("keyrest", true),
42-
anonblock("block", true),
41+
unnamedreq("req", true),
42+
unnamedopt("opt", true),
4343
unnamedrest("rest", true),
44-
nokey("nokey", true); // **nil
44+
unnamedkeyrest("keyrest", true),
45+
46+
nokey("nokey", true);
4547

4648
ArgumentType(String symbolicName, boolean anonymous) {
4749
this.symbolicName = symbolicName;

0 commit comments

Comments
 (0)