diff --git a/modules/packages/RecordParser.chpl b/modules/packages/RecordParser.chpl index 1c383e22ebd6..85d0aeadc931 100644 --- a/modules/packages/RecordParser.chpl +++ b/modules/packages/RecordParser.chpl @@ -118,7 +118,7 @@ class RecordReader { /* The regular expression to read (using match on the channel) */ var matchRegex: regex(string); @chpldoc.nodoc - param num_fields = numFields(t); // Number of fields in record + param num_fields = getNumFields(t); // Number of fields in record /* Create a RecordReader to match an auto-generated regular expression for a record created by the :proc:`createRegex` routine. diff --git a/modules/packages/ZMQ.chpl b/modules/packages/ZMQ.chpl index 6da4fc8947af..0f86f29c9793 100644 --- a/modules/packages/ZMQ.chpl +++ b/modules/packages/ZMQ.chpl @@ -942,7 +942,7 @@ module ZMQ { (!isBytes(T))) { on classRef.home { var copy = data; - param N = numFields(T); + param N = getNumFields(T); for param i in 0..<(N-1) do try send(getField(copy,i), ZMQ_SNDMORE | flags); @@ -1045,7 +1045,7 @@ module ZMQ { var ret: T; on classRef.home { var data: T; - for param i in 0..= 0 && idx < numFields(t) && + where idx >= 0 && idx < getNumFields(t) && isParam(__primitive("field by num", obj, idx+1)) { return __primitive("field by num", obj, idx+1); @@ -92,20 +88,20 @@ proc getField(const ref obj:?t, param idx: int) param // over the const ref one. /* Get the field at `idx` in a class or record. When the field at `idx` is a `type` variable, this overload will be chosen to return a type. - Causes a compilation error if `idx` is not in 0..= 0 && idx < numFields(t) && + where idx >= 0 && idx < getNumFields(t) && isType(__primitive("field by num", obj, idx+1)) { return __primitive("field by num", obj, idx+1); } /* Get the field at `idx` in a class or record. - Causes a compilation error if `idx` is not in 0.. $2.tmp -mv $2.tmp $2 +sed '\|CHPL_HOME/modules|s/:[0-9]*:/:nnnn:/' $2 > $2.1.tmp +grep 'chpl_unstableStandardSymbolForTesting\|chpl_unstableInternalSymbolForTesting' $2.1.tmp > $2.2.tmp +mv $2.2.tmp $2 +rm $2.1.tmp diff --git a/test/deprecated/ReflectionNumFields.chpl b/test/deprecated/ReflectionNumFields.chpl new file mode 100644 index 000000000000..296446ece4e2 --- /dev/null +++ b/test/deprecated/ReflectionNumFields.chpl @@ -0,0 +1,7 @@ +use Reflection; + +record rec { var x = 0; } + +proc main() { + param n = numFields(rec); +} diff --git a/test/deprecated/ReflectionNumFields.good b/test/deprecated/ReflectionNumFields.good new file mode 100644 index 000000000000..3b291511faae --- /dev/null +++ b/test/deprecated/ReflectionNumFields.good @@ -0,0 +1,2 @@ +ReflectionNumFields.chpl:5: In function 'main': +ReflectionNumFields.chpl:6: warning: 'numFields' is deprecated - please use 'getNumFields' instead diff --git a/test/functions/resolution/ignore-unreachable.chpl b/test/functions/resolution/ignore-unreachable.chpl index daa99bac4dde..c72aa0309e4f 100644 --- a/test/functions/resolution/ignore-unreachable.chpl +++ b/test/functions/resolution/ignore-unreachable.chpl @@ -9,7 +9,7 @@ record Foo { var foo = new Foo(); -for param i in 0..