Вопрос

I'm trying to abort a task in ada program but I get this error during compilation:

expect task name or task interface class-wide object for "abort"

The code looks like this:

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;

And again when I try line like this:

abort Sending_Message;

I get error:

invalid use of subtype mark in expression or call

Any idea what is wrong?

Это было полезно?

Решение

You have to explicitly dereference the access type:

abort send.all;
Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top