Two Scala annotations
Dmitry Olshansky
dmitry.olsh at gmail.com
Sun May 27 07:04:45 PDT 2012
On 27.05.2012 17:13, bearophile wrote:
> I have found two Scala annotations.
>
> 1) The first one is @switch:
> http://www.scala-lang.org/api/current/scala/annotation/switch.html
>
> Currently this D2 code compiles:
>
> void main() {
> int x = 2;
> int y = 2;
> switch(x) {
> case 1: break;
> case y: break;
> default:
> }
> }
>
IMHO if you use annotations for *this* then your language is as good as
dead.
There are far better things to aim annotations at.
> 2) The second is @implicitNotFound:
> http://www.scala-lang.org/api/current/scala/annotation/implicitNotFound.html
>
>
> More info:
> http://suereth.blogspot.it/2011/03/annotate-your-type-classes.html
>
--
Dmitry Olshansky
More information about the Digitalmars-d
mailing list