Open fridis opened 2 months ago
the following patch does not seem to suffice:
diff --git a/src/dev/flang/ast/Call.java b/src/dev/flang/ast/Call.java
index 16496b9a6..97af04ff5 100644
--- a/src/dev/flang/ast/Call.java
+++ b/src/dev/flang/ast/Call.java
@@ -1341,6 +1341,19 @@ public class Call extends AbstractCall
Generic g = frmlT.genericArgument();
var frmlTs = g.replaceOpen(g.feature() == _calledFeature
? _generics
+ /* example where this applies:
+ *
+ * a(U type,
+ * F type : Function U,
+ * f F) U => f.call
+ *
+ * say (a bool B B)
+ *
+ * B : Function (option i32) is
+ * redef call option i32 => 32
+ */
+ : _target.type().isGenericArgument()
+ ? _target.type().genericArgument().constraint(context).generics()
: _target.type().generics());
addToResolvedFormalArgumentTypes(res, argnum + i, frmlTs.toArray(new AbstractType[frmlTs.size()]), frml);
i = i + frmlTs.size() - 1;
This small example defines feature
a
that receives an argument of typeS type : Sequence U
, but ifU
isbool
, thenS
might beSeqence i32
:which causes a crash in DFA:
A similar example with a function argument
causes an error only during execution