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

Scala example source code file (type-diagnostics.check)

This example Scala source code file (type-diagnostics.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

calculator, expected, expected, hello, list, list, sls, string, string, the, the

The Scala type-diagnostics.check source code

type-diagnostics.scala:4: error: type mismatch;
 found   : scala.collection.Set[String]
 required: scala.collection.immutable.Set[String]
  def f = Calculator("Hello", binding.keySet: collection.Set[String])
                                            ^
type-diagnostics.scala:13: error: type mismatch;
 found   : List[a(in method f2)]
 required: List[a(in method f1)]
      y match { case y1: List[a] => f3(x, y1) }
                                          ^
type-diagnostics.scala:17: error: type mismatch;
 found   : String(in method f2)
 required: java.lang.String
  def f2[String](s: String) = strings(List(s))
                                           ^
type-diagnostics.scala:21: error: missing parameter type for expanded function
The argument types of an anonymous function must be fully known. (SLS 8.5)
Expected type was: ?
  val f = { case 5 => 10 }
          ^
four errors found

Other Scala examples (source code examples)

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

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

#1 New Release!

FP Best Seller

 

new blog posts

 

Copyright 1998-2024 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.