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
Description:
Ignoring the return value of a type function with a user defined generic type causes a compiler segfault. Making the type concrete or capturing the return value (type x = ...) restores correct behavior.
Is this a blocking issue with no known work-arounds?
The workaround is to just use a unused return value like type x = ...
Steps to Reproduce
Source Code:
record R1 { }
record R2 { type t; }
record R3 { type t =int; }
proc bar(type t) type {
compilerWarning(t:string);
return t;
}
bar(int);
bar(R1);
bar(R2); // segfaults at compile-time
bar(R2(?)); // segfaults at compile-time
bar(R2(int));
bar(R3); // segfaults at compile-time
bar(R3(?)); // segfaults at compile-time
bar(R3(real));
type x = bar(R2); // this is fine
Summary of Problem
Description:
Ignoring the return value of a type function with a user defined generic type causes a compiler segfault. Making the type concrete or capturing the return value (
type x = ...
) restores correct behavior.Is this a blocking issue with no known work-arounds?
The workaround is to just use a unused return value like
type x = ...
Steps to Reproduce
Source Code:
Compile command:
chpl foo.chpl
Associated Future Test:
test/functions/generic/type-func-return-generic.chpl
Configuration Information
chpl --version
: chpl version 2.1.0 pre-release (6eb9035)$CHPL_HOME/util/printchplenv --anonymize
:gcc --version
orclang --version
: Homebrew clang version 17.0.6The text was updated successfully, but these errors were encountered: