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
The Inliner throws on a program with sum in the group clause. This program fails:
fun mapReduce2 mapper reducer list =
from e in list,
(k, v) in mapper e
group k compute c = sum of v;
with
java.lang.ClassCastException: class net.hydromatic.morel.type.TypeVar cannot be cast to class net.hydromatic.morel.type.PrimitiveType (net.hydromatic.morel.type.TypeVar and net.hydromatic.morel.type.PrimitiveType are in unnamed module of loader 'app')
at net.hydromatic.morel.eval.Codes.lambda$static$6(Codes.java:1454)
at net.hydromatic.morel.compile.Inliner.visit(Inliner.java:90)
at net.hydromatic.morel.ast.Core$Id.accept(Core.java:459)
at net.hydromatic.morel.ast.Shuttle.visit(Shuttle.java:369)
at net.hydromatic.morel.ast.Core$Aggregate.accept(Core.java:1126)
while this similar program succeeds:
fun int_sum [] = 0
| int_sum (x :: xs) = x + (int_sum xs);
val int_sum = fn : int list -> int
fun mapReduce2 mapper reducer list =
from e in list,
(k, v) in mapper e
group k compute c = int_sum of v;
val mapReduce2 = fn
: ('a -> ('b * int) list) -> 'c -> 'a list -> {c:int, k:'b} list
I think the problem is that Relational.sum has a polymorphic type (which we convert to either int or real during type inference).
The text was updated successfully, but these errors were encountered:
The Inliner throws on a program with
sum
in thegroup
clause. This program fails:with
while this similar program succeeds:
I think the problem is that
Relational.sum
has a polymorphic type (which we convert to eitherint
orreal
during type inference).The text was updated successfully, but these errors were encountered: