This week's book giveaway is in the Mac OS forum.
We're giving away four copies of a choice of "Take Control of Upgrading to Yosemite" or "Take Control of Automating Your Mac" and have Joe Kissell on-line!
See this thread for details.
The moose likes Scala and the fly likes Scala Manifest for Type error Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

JavaRanch » Java Forums » Languages » Scala
Bookmark "Scala Manifest for Type error" Watch "Scala Manifest for Type error" New topic

Scala Manifest for Type error

Joe Harry
Ranch Hand

Joined: Sep 26, 2006
Posts: 9398

A simple Scala method as mentioned below:

When compiled, gives me the error as below:

Any clues? This is the strangest error that I have ever faced.

SCJP 1.4, SCWCD 1.4 - Hints for you, Certified Scrum Master
Did a rm -R / to find out that I lost my entire Linux installation!
Joe Harry
Ranch Hand

Joined: Sep 26, 2006
Posts: 9398

Got this solved! Here is a reference to what needs to be done. Just add an implicit parameter!
Jesper de Jong
Java Cowboy
Saloon Keeper

Joined: Aug 16, 2005
Posts: 14194

Or a context bound. A context bound looks like this:

It's the same as this:

You read the line with the context bound as: "method asType takes a type parameter A for which there is a Manifest".

Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 8 API documentation
wood burning stoves
subject: Scala Manifest for Type error