Al: No error when interface with event is not correctly implemented

Created on 2 Apr 2020  Â·  4Comments  Â·  Source: microsoft/AL

Describe the bug
When you implement an interface that contains an event, VS Code will not show an error if the event is just implemented as a function and not marked as an event.

To Reproduce

interface IDemo
{
    trigger OnWhatever();
    begin
    end;
}

codeunit 50000 Demo implements IDemo
{
    procedure OnWhatever()
    begin
    end;
} 

Expected behavior
As long as procedure OnWhatever() is not marked as an event, there should be an error that the interface is not correctly implemented.

Screenshots
image

5. Versions:

  • AL Language: 5.0.254558
  • Business Central: n/a
bug in-progress

Most helpful comment

Edit: Maybe I'm going too fast here... Just noticed that it is not even possible (yet?) to subscribe to an event from an interface...

I do really hope that will become possible in the future!

All 4 comments

Edit: Maybe I'm going too fast here... Just noticed that it is not even possible (yet?) to subscribe to an event from an interface...

I do really hope that will become possible in the future!

Yep, we had that discussion as well, you also can't define a publisher in an interface, which woudl be very helpful

Being able to use the Trigger keyword in the interface is a bug.

This issue has been fixed in our latest developer preview for AL extensions that are using version 6.0.307310 or higher. An error is now reported on interfaces declaring a trigger.

image

Was this page helpful?
0 / 5 - 0 ratings