WhileyCompiler icon indicating copy to clipboard operation
WhileyCompiler copied to clipboard

Support Annotations on Methods

Open DavePearce opened this issue 4 years ago • 2 comments

The intention is to allow a @test annotation.

DavePearce avatar Oct 27 '21 00:10 DavePearce

What is the format? Its an @ followed by an identifier that represents a type name which is resolved in the usual fashion for types, and which may be followed by a value. For example:

import uint from std::integer

@uint(0)
function blah():
 ...

(obviously this one isn't very useful)

DavePearce avatar Oct 27 '21 00:10 DavePearce

There are three supports value formats:

  • Primitives
@test(0)
  • Records
@test{field: 1}
  • Arrays
@test[1,2,3]

DavePearce avatar Oct 27 '21 00:10 DavePearce