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

Scala example source code file (divergent-implicit.check)

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

bar, bar, baz, foo, int, int, string, string, test1, test2, test2

The Scala divergent-implicit.check source code

divergent-implicit.scala:4: error: type mismatch;
 found   : Int(1)
 required: String
  val x1: String = 1
                   ^
divergent-implicit.scala:5: error: diverging implicit expansion for type Int => String
starting with method cast in object Test1
  val x2: String = cast[Int, String](1)
                                    ^
divergent-implicit.scala:14: error: diverging implicit expansion for type Test2.Baz => Test2.Bar
starting with method baz2bar in object Test2
  val x: Bar = new Foo
               ^
divergent-implicit.scala:15: error: diverging implicit expansion for type Test2.Foo => Test2.Bar
starting with method foo2bar in object Test2
  val y: Bar = new Baz
               ^
four errors found

Other Scala examples (source code examples)

Here is a short list of links related to this Scala divergent-implicit.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.