Reputation: 181
I'm trying to do this:
data A = a(str s);
void show(A a(str s)) = println(s);
A x = a("hi");
show(x);
but I get this error:
|prompt:///|(0,7,<1,0>,<1,7>): The called signature: show(A),
does not match the declared signature: void show(node);
Is this because this is currently broken (as the tutor page for TypeConstrained abstract patterns suggests), or am I making a mistake?
Upvotes: 1
Views: 31
Reputation: 15439
I think it should be
void show(a(str s)) = println(s);
where did you see this A
prefix in the tutor?
Upvotes: 1