我正在尝试这样做:
data A = a(str s);
void show(A a(str s)) = println(s);
A x = a("hi");
show(x);
但是我收到了这个错误:
|prompt:///|(0,7,<1,0>,<1,7>): The called signature: show(A),
does not match the declared signature: void show(node);
这是因为目前这已经破坏了(因为TypeConstrained抽象模式的教师页面建议),还是我犯了错误?
答案 0 :(得分:1)
我认为应该是
void show(a(str s)) = println(s);
你在哪里看到导师的这个A
前缀?