alvinalexander.com | career | drupal | java | mac | mysql | perl | scala | uml | unix  

Scala example source code file (varargs.check)

This example Scala source code file (varargs.check) is included in the DevDaily.com "Java Source Code Warehouse" project. The intent of this project is to help you "Learn Java by Example" TM.

Java - Scala tags/keywords

a, a, int, int, string, string

The Scala varargs.check source code

varargs.scala:16: error: A method with a varargs annotation produces a forwarder method with the same signature (a: Int, b: Array[java.lang.String])Int as an existing method.
    @varargs def v1(a: Int, b: String*) = a + b.length
                 ^
varargs.scala:19: error: A method without repeated parameters cannot be annotated with the `varargs` annotation.
  @varargs def nov(a: Int) = 0
               ^
varargs.scala:21: error: A method with a varargs annotation produces a forwarder method with the same signature (a: Int, b: Array[java.lang.String])Int as an existing method.
  @varargs def v2(a: Int, b: String*) = 0
               ^
three errors found

Other Scala examples (source code examples)

Here is a short list of links related to this Scala varargs.check source code file:

... this post is sponsored by my books ...

#1 New Release!

FP Best Seller

 

new blog posts

 

Copyright 1998-2021 Alvin Alexander, alvinalexander.com
All Rights Reserved.

A percentage of advertising revenue from
pages under the /java/jwarehouse URI on this website is
paid back to open source projects.