You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I encountered an internal module error message when I called a method (lines()) on a field (stdout) of a promoted expression of objects (subprocess).
I have not attempted to distill the reproducer past this, so I am not confident in how generally this error message applies.
I ran into this when modifying my interface of f() from f(s: [] string) -> f(s: string)), and started getting unintentional promotion.
Steps to Reproduce
Source Code:
use Spawn;
proc f(s:string) {
var p = spawnshell(s, stdout=PIPE, stderr=PIPE);
p.communicate();
return p;
}
var p = f(['ls', '-l']);
var lines = p.stdout.lines(); // <-- offending expression
Compile command:
> chpl Lines.chpl
$CHPL_HOME/modules/internal/ChapelIteratorSupport.chpl:283: error: illegal return of value where type is expected
> chpl Lines.chpl --devel
$CHPL_HOME/modules/internal/ChapelIteratorSupport.chpl:278: In function'chpl_iteratorShapeStaticTypeOrVoid':$CHPL_HOME/modules/internal/ChapelIteratorSupport.chpl:283: error: illegal return of value where type is expected
$CHPL_HOME/modules/internal/ChapelIteratorSupport.chpl:166: Function 'chpl_iteratorShapeStaticTypeOrVoid' instantiated as: chpl_iteratorShapeStaticTypeOrVoid(type ir = _ir_lines__ref_channel_F_dynamic_T)
Configuration Information
Output of chpl --version: chpl version 1.21.0 pre-release (f3e74adea4)
The text was updated successfully, but these errors were encountered:
It looks to me as though the none on ChapelIteratorSupport.chpl:283 should be nothing. Does making that change help? (I don't have a clean copy of master to test with quickly). It looks like the callsite is correctly expecting nothing to come back as the sentinel.
If PR-ing this fix, we should either change these nothings back to void or change the procedure name to say Nothing rather than Void.
(I'm guessing this code path isn't tested or that @daviditen would've run into this problem when making the change in ed48984).
OK, I beat you to it: Making the change gives the following error message:
testit2.chpl:10: error: creating an array of arrays using a for- or forall-expression is not supported, except when using a for-expression over a range
which I think is correct (i.e., I think your code is trying to do this and that we don't currently support it).
bradcray
pushed a commit
to bradcray/chapel
that referenced
this issue
Nov 8, 2019
Fix a simple bug that had crept into ChapelIteratorSupport
[reviewed by @mppf and @daviditen]
This fixes a bug that crept into ChapelIteratorSupport in which we
were returning the 'none' value in a function that is supposed to
return types. Here, rather than changing the type into 'nothing', I
changed it back to the original 'void' since (a) it matches the
original function name's statement of what it's doing and (b) the type
is used as a sentinel value, so it doesn't particularly matter that
it's a type that has no values.
Resolves#14408
Summary of Problem
I encountered an internal module error message when I called a method (
lines()
) on a field (stdout
) of a promoted expression of objects (subprocess
).I have not attempted to distill the reproducer past this, so I am not confident in how generally this error message applies.
I ran into this when modifying my interface of
f()
fromf(s: [] string) -> f(s: string)
), and started getting unintentional promotion.Steps to Reproduce
Source Code:
Compile command:
Configuration Information
chpl --version
:chpl version 1.21.0 pre-release (f3e74adea4)
The text was updated successfully, but these errors were encountered: