Skip to content

Commit 22f79cb

Browse files
committed
Fixes for changed RandomValue interface
1 parent ccafcef commit 22f79cb

File tree

6 files changed

+8
-9
lines changed

6 files changed

+8
-9
lines changed

src/org/rascalmpl/library/Prelude.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -164,8 +164,7 @@ public Prelude(IValueFactory values, IRascalValueFactory rascalValues, PrintWrit
164164

165165
private IValue createRandomValue(Type t, int depth, int width) {
166166
return t.randomValue(
167-
random,
168-
RandomTypesConfig.defaultConfig(random).withoutRandomAbstractDatatypes(),
167+
random,
169168
values,
170169
new TypeStore(),
171170
Collections.emptyMap(),
@@ -3942,7 +3941,7 @@ public IValue randomValue(IValue type, IInteger seed, IInteger depth, IInteger w
39423941
// don't change the set of types dynamically. the test functions that use this function
39433942
// have already been type-checked in their static source context.
39443943
RandomTypesConfig typesConfig = RandomTypesConfig.defaultConfig(random).withoutRandomAbstractDatatypes();
3945-
return start.randomValue(random, typesConfig, values, store, Collections.emptyMap(), depth.intValue(), width.intValue());
3944+
return start.randomValue(random, values, store, Collections.emptyMap(), depth.intValue(), width.intValue());
39463945
}
39473946

39483947
// Utilities used by Graph

src/org/rascalmpl/runtime/$RascalModule.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ public abstract class $RascalModule {
122122
protected final RascalExecutionContext $rex;
123123

124124
//protected final IValueFactory $RVF;
125-
protected final TypeFactory $TF;
125+
public final TypeFactory $TF;
126126
protected final RascalTypeFactory $RTF;
127127
public final TypeStore $TS;
128128
protected final Traverse $TRAVERSE;

src/org/rascalmpl/runtime/utils/GenerateActuals.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ public Stream<IValue[]> generateActuals(Type[] formals, TypeStore $TS) {
7777
continue;
7878
}
7979

80-
values[n] = types[n].randomValue(random, typesConfig, $VF, $TS, tpbindings, maxDepth, maxWidth);
80+
values[n] = types[n].randomValue(random, $VF, $TS, tpbindings, maxDepth, maxWidth);
8181
}
8282

8383
return values;

src/org/rascalmpl/test/infrastructure/QuickCheck.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ public TestResult test(String functionName, Type formals, String expectedExcepti
8080
// TODO: here we could reuse a previous parameter (once in a while) if it
8181
// has a comparable actual type, to cover more cases in the test code
8282
// where it is necessary that two parameter values match or are equal.
83-
values[n] = types[n].randomValue(random, typesConfig, vf, store, tpbindings, maxDepth, maxWidth);
83+
values[n] = types[n].randomValue(random, vf, store, tpbindings, maxDepth, maxWidth);
8484
}
8585

8686
for (int n = 0; n < formals.getArity(); n++) {
@@ -102,7 +102,7 @@ public TestResult test(String functionName, Type formals, String expectedExcepti
102102
for (int width = 1; width < maxWidth && !smallerFound; width++) {
103103
for (int j = 0; j < tries && !smallerFound; j++) {
104104
for (int n = 0; n < values.length; n++) {
105-
smallerValues[n] = types[n].randomValue(random, RandomTypesConfig.defaultConfig(random).withoutRandomAbstractDatatypes(), vf, store, tpbindings, maxDepth, maxWidth);
105+
smallerValues[n] = types[n].randomValue(random, vf, store, tpbindings, maxDepth, maxWidth);
106106
}
107107

108108
for (int n = 0; n < formals.getArity(); n++) {

src/org/rascalmpl/types/NonTerminalType.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -522,7 +522,7 @@ public String toString() {
522522
}
523523

524524
@Override
525-
public IValue randomValue(Random random, RandomTypesConfig typesConfig, IValueFactory vf, TypeStore store, Map<Type, Type> typeParameters,
525+
public IValue randomValue(Random random, IValueFactory vf, TypeStore store, Map<Type, Type> typeParameters,
526526
int maxDepth, int maxBreadth) {
527527
// TODO this should be made more carefully (use the grammar to generate a true random instance of the
528528
// given non-terminal

src/org/rascalmpl/types/ReifiedType.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,7 @@ public int hashCode() {
247247
}
248248

249249
@Override
250-
public IValue randomValue(Random random, RandomTypesConfig typesConfig, IValueFactory vf, TypeStore store, Map<Type, Type> typeParameters,
250+
public IValue randomValue(Random random, IValueFactory vf, TypeStore store, Map<Type, Type> typeParameters,
251251
int maxDepth, int maxBreadth) {
252252

253253
if (store instanceof TypeStoreWithSyntax) {

0 commit comments

Comments
 (0)