You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is an alternative to the proposed change in #2069, that solves the same issue outline in #1283.
This would allow composites to inherit events directly from interfaces, rather than requiring them to redeclare these events identically to the interface's definition in the body of the composite. E.g. this:
would be valid, as S has inherited the definition of Foo from I. Note also that here the events are declared/inherited by a struct rather than a contract, as in order to support a proposed change in the new NFT standard (where events are defined in the Vault resource rather than the contract), we would also permit arbitrary composites to define events.
The text was updated successfully, but these errors were encountered:
My only concern is this inherit. If we convert events from types to functions. ( with interface default functions etc.) , everything makes more sense.
event becomes kind of a function ( typealias event fun ) pub event Foo(x: string) -> pub fun Foo(x: string): #Foo ( # being event decorator, like @ for resources )
emit Foo(x:"data") becomes emit #Foo(d:data)
In this way, we don't introduce any inheritance to the language as an exceptional case, it looks similar to create stuff.
This is an alternative to the proposed change in #2069, that solves the same issue outline in #1283.
This would allow composites to inherit events directly from interfaces, rather than requiring them to redeclare these events identically to the interface's definition in the body of the composite. E.g. this:
would be valid, as
S
has inherited the definition ofFoo
fromI
. Note also that here the events are declared/inherited by a struct rather than a contract, as in order to support a proposed change in the new NFT standard (where events are defined in theVault
resource rather than the contract), we would also permit arbitrary composites to define events.The text was updated successfully, but these errors were encountered: