我正在尝试在ada程序中中止任务,但在编译期间出现此错误:
expect task name or task interface class-wide object for "abort"
代码如下所示:
task type Sending_Message;
type Send_Message is access Sending_Message;
declare
send : Send_Message;
begin
send := new Sending_Message;
...
abort send; -- this line throws error
end;
当我尝试这样的行时:
abort Sending_Message;
我收到错误:
invalid use of subtype mark in expression or call
知道出了什么问题吗?
答案 0 :(得分:4)
您必须明确取消引用访问类型:
abort send.all;