The Artima Developer Community
Sponsored Link

ScalaTest/ScalaUtils Forum
Quick Start Example Compilation Failure

1 reply on 1 page. Most recent reply: Apr 4, 2017 1:17 PM by David Bess

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
    Next Topic
Flat View: This topic has 1 reply on 1 page
David Bess

Posts: 2
Nickname: davidbess
Registered: Apr, 2017

Quick Start Example Compilation Failure Posted: Apr 4, 2017 12:29 PM
Reply to this message Reply
Advertisement
Greetings,

I am attempting to get started by following the example listed here:

http://www.scalatest.org/quick_start

Here is my console input / output. Not sure what I could possibly be doing wrong.

I apologize in advance if I have missed something obvious.

Thanks,

David

-----------------------------------------



C:\java8\project \scala-test>dir
Volume in drive C is Windows
Volume Serial Number is D2FA-96C8

Directory of C:\java8\project\scala-test

04/04/2017 12:14 PM <DIR> .
04/04/2017 12:14 PM <DIR> ..
04/04/2017 12:12 PM 522 ExampleSpec.scala
04/04/2017 12:12 PM 11,163,008 scalatest-app_2.11-3.0.1.jar
2 File(s) 11,163,530 bytes
2 Dir(s) 101,064,196,096 bytes free

C:\java8\project\scala-test>type ExampleSpec.scala
import collection.mutable.Stack
import org.scalatest._

class ExampleSpec extends FlatSpec with Matchers {

"A Stack" should "pop values in last-in-first-out order" in {
val stack = new Stack[Int]
stack.push(1)
stack.push(2)
stack.pop() should be (2)
stack.pop() should be (1)
}

it should "throw NoSuchElementException if an empty stack is popped" in {
val emptyStack = new Stack[Int]
a [NoSuchElementException] should be thrownBy {
emptyStack.pop()
}
}
}
C:\java8\project\scala-test>scalac -cp scalatest-app_2.11-3.0.1.jar ExampleSpec.scala
error:
while compiling: ExampleSpec.scala
during phase: typer
library version: version 2.10.4
compiler version: version 2.10.4
reconstructed args: -classpath scalatest-app_2.11-3.0.1.jar

last tree to typer: Select(This(package source), Position)
symbol: object Position in package source (flags: <module>)
symbol definition: object Position
tpe: org.scalactic.source.Position.type
symbol owners: object Position -> package source
context owners: value <local ExampleSpec> -> class ExampleSpec -> package <empty>

== Enclosing template or block ==

Template( // val <local ExampleSpec>: <notype> in class ExampleSpec
"FlatSpec", "Matchers" // parents
ValDef(
private
"_"
<tpt>
<empty>
)
// 3 statements
DefDef( // def <init>(): ExampleSpec in class ExampleSpec
<method>
"<init>"
[]
List(Nil)
<tpt> // tree.tpe=ExampleSpec
Block( // tree.tpe=Unit
Apply( // def <init>(): org.scalatest.FlatSpec in class FlatSpec, tree.tpe=org.scalatest.FlatSpec
ExampleSpec.super."<init>" // def <init>(): org.scalatest.FlatSpec in class FlatSpec, tree.tpe=()org.scalatest.FlatSpec
Nil
)
()
)
)
Apply(
"A Stack".should("pop values in last-in-first-out order")."in"
Block(
// 4 statements
ValDef(
0
"stack"
<tpt>
Apply(
new Stack[Int]."<init>"
Nil
)
)
Apply(
"stack"."push"
1
)
Apply(
"stack"."push"
2
)
Apply(
stack.pop()."should"
Apply(
"be"
2
)
)
Apply(
stack.pop()."should"
Apply(
"be"
1
)
)
)
)
Apply(
it.should("throw NoSuchElementException if an empty stack is popped")."in"
Block(
ValDef(
0
"emptyStack"
<tpt>
Apply(
new Stack[Int]."<init>"
Nil
)
)
Apply(
a[NoSuchElementException].should(be)."thrownBy"
Apply(
"emptyStack"."pop"
Nil
)
)
)
)
)

== Expanded type of tree ==

SingleType(pre = ThisType(package source), object Position)

uncaught exception during compilation: scala.MatchError
error: scala.MatchError: false (of class scala.reflect.internal.Trees$Literal)
at scala.tools.nsc.typechecker.Macros$MacroImplBinding$.unpickleAtom(Macros.scala: 118)
at scala.tools.nsc.typechecker.Macros$MacroImplBinding$$anonfun$6.apply(Macros.sca la:186)
at scala.tools.nsc.typechecker.Macros$MacroImplBinding$$anonfun$6.apply(Macros.sca la:186)
at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:244 )
at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:244 )
at scala.collection.immutable.List.foreach(List.scala:318)
at scala.collection.TraversableLike$class.map(TraversableLike.scala:244)
at scala.collection.AbstractTraversable.map(Traversable.scala:105)
at scala.tools.nsc.typechecker.Macros$MacroImplBinding$.unpickle(Macros.scala:186)
at scala.tools.nsc.typechecker.Macros$class.scala$tools$nsc$typechecker$Macros$$lo adMacroImplBinding(Macros.scala:205)
at scala.tools.nsc.typechecker.Macros$$anonfun$scala$tools$nsc$typechecker$Macros$ $macroRuntime$3.apply(Macros.scala:522)
at scala.tools.nsc.typechecker.Macros$$anonfun$scala$tools$nsc$typechecker$Macros$ $macroRuntime$3.apply(Macros.scala:521)
at scala.collection.mutable.MapLike$class.getOrElseUpdate(MapLike.scala:189)
at scala.collection.mutable.AbstractMap.getOrElseUpdate(Map.scala:91)
at scala.tools.nsc.typechecker.Macros$class.scala$tools$nsc$typechecker$Macros$$ma croRuntime(Macros.scala:521)
at scala.tools.nsc.typechecker.Macros$$anonfun$scala$tools$nsc$typechecker$Macros$ $macroExpand1$1.apply(Macros.scala:795)
at scala.tools.nsc.typechecker.Macros$$anonfun$scala$tools$nsc$typechecker$Macros$ $macroExpand1$1.apply(Macros.scala:787)
at scala.tools.nsc.Global.withInfoLevel(Global.scala:190)
at scala.tools.nsc.typechecker.Macros$class.scala$tools$nsc$typechecker$Macros$$ma croExpand1(Macros.scala:787)
at scala.tools.nsc.typechecker.Macros$class.macroExpand(Macros.scala:701)
at scala.tools.nsc.Global$$anon$1.macroExpand(Global.scala:493)
at scala.tools.nsc.typechecker.Typers$Typer.adapt(Typers.scala:1152)
at scala.tools.nsc.typechecker.Typers$Typer.adapt(Typers.scala:1102)
at scala.tools.nsc.typechecker.Implicits$ImplicitSearch.typedImplicit1(Implicits.s cala:679)
at scala.tools.nsc.typechecker.Implicits$ImplicitSearch.typedImplicit0(Implicits.s cala:631)
at scala.tools.nsc.typechecker.Implicits$ImplicitSearch.pre211DivergenceLogic$1(Im plicits.scala:468)
at scala.tools.nsc.typechecker.Implicits$ImplicitSearch.scala$tools$nsc$typechecke r$Implicits$ImplicitSearch$$typedImplicit(Implicits.scala:499)
at scala.tools.nsc.typechecker.Implicits$ImplicitSearch$ImplicitComputation.pre211 tryImplicitInfo$1(Implicits.scala:932)
at scala.tools.nsc.typechecker.Implicits$ImplicitSearch$ImplicitComputation.rankIm plicits(Implicits.scala:940)
at scala.tools.nsc.typechecker.Implicits$ImplicitSearch$ImplicitComputation.findBe st(Implicits.scala:979)
at scala.tools.nsc.typechecker.Implicits$ImplicitSearch.searchImplicit(Implicits.s cala:1040)
at scala.tools.nsc.typechecker.Implicits$ImplicitSearch.bestImplicit(Implicits.sca la:1427)
at scala.tools.nsc.typechecker.Implicits$class.inferImplicit(Implicits.scala:82)
at scala.tools.nsc.Global$$anon$1.inferImplicit(Global.scala:493)
at scala.tools.nsc.typechecker.Implicits$class.inferImplicit(Implicits.scala:37)
at scala.tools.nsc.Global$$anon$1.inferImplicit(Global.scala:493)
at scala.tools.nsc.typechecker.Typers$Typer.applyImplicitArgs(Typers.scala:127)
at scala.tools.nsc.typechecker.Typers$Typer.adaptToImplicitMethod$1(Typers.scala:8 69)
at scala.tools.nsc.typechecker.Typers$Typer.adapt(Typers.scala:1126)
at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:5660)
at scala.tools.nsc.typechecker.Typers$Typer.typedQualifier(Typers.scala:5727)
at scala.tools.nsc.typechecker.Typers$Typer.typedQualifier(Typers.scala:5735)
at scala.tools.nsc.typechecker.Typers$Typer.adaptToMember(Typers.scala:1349)
at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$18.apply(Typers.scala:1400)
at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$18.apply(Typers.scala:1400)
at scala.tools.nsc.typechecker.Typers$Typer.silent(Typers.scala:745)
at scala.tools.nsc.typechecker.Typers$Typer.adaptToMemberWithArgs(Typers.scala:140 0)
at scala.tools.nsc.typechecker.Typers$Typer.scala$tools$nsc$typechecker$Typers$Typ er$$typedSelect$1(Typers.scala:4793)
at scala.tools.nsc.typechecker.Typers$Typer.typedSelectOrSuperCall$1(Typers.scala: 4933)
at scala.tools.nsc.typechecker.Typers$Typer.typed1(Typers.scala:5563)
at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:5642)
at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$93.apply(Typers.scala:4608)
at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$93.apply(Typers.scala:4608)
at scala.tools.nsc.typechecker.Typers$Typer.silent(Typers.scala:727)
at scala.tools.nsc.typechecker.Typers$Typer.normalTypedApply$1(Typers.scala:4608)
at scala.tools.nsc.typechecker.Typers$Typer.typedApply$1(Typers.scala:4659)
at scala.tools.nsc.typechecker.Typers$Typer.typed1(Typers.scala:5564)
at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:5642)
at scala.tools.nsc.typechecker.Typers$Typer.typedQualifier(Typers.scala:5727)
at scala.tools.nsc.typechecker.Typers$Typer.typedQualifier(Typers.scala:5733)
at scala.tools.nsc.typechecker.Typers$Typer.typedSelectOrSuperCall$1(Typers.scala: 4913)
at scala.tools.nsc.typechecker.Typers$Typer.typed1(Typers.scala:5563)
at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:5642)
at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$93.apply(Typers.scala:4608)
at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$93.apply(Typers.scala:4608)
at scala.tools.nsc.typechecker.Typers$Typer.silent(Typers.scala:727)
at scala.tools.nsc.typechecker.Typers$Typer.normalTypedApply$1(Typers.scala:4608)
at scala.tools.nsc.typechecker.Typers$Typer.typedApply$1(Typers.scala:4659)
at scala.tools.nsc.typechecker.Typers$Typer.typed1(Typers.scala:5564)
at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:5642)
at scala.tools.nsc.typechecker.Typers$Typer.scala$tools$nsc$typechecker$Typers$Typ er$$typedStat$1(Typers.scala:2928)
at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$61.apply(Typers.scala:3032)
at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$61.apply(Typers.scala:3032)
at scala.collection.immutable.List.loop$1(List.scala:170)
at scala.collection.immutable.List.mapConserve(List.scala:186)
at scala.tools.nsc.typechecker.Typers$Typer.typedStats(Typers.scala:3032)
at scala.tools.nsc.typechecker.Typers$Typer.typedTemplate(Typers.scala:1919)
at scala.tools.nsc.typechecker.Typers$Typer.typedClassDef(Typers.scala:1759)
at scala.tools.nsc.typechecker.Typers$Typer.typed1(Typers.scala:5583)
at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:5642)
at scala.tools.nsc.typechecker.Typers$Typer.scala$tools$nsc$typechecker$Typers$Typ er$$typedStat$1(Typers.scala:2928)
at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$61.apply(Typers.scala:3032)
at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$61.apply(Typers.scala:3032)
at scala.collection.immutable.List.loop$1(List.scala:170)
at scala.collection.immutable.List.mapConserve(List.scala:186)
at scala.tools.nsc.typechecker.Typers$Typer.typedStats(Typers.scala:3032)
at scala.tools.nsc.typechecker.Typers$Typer.typedPackageDef$1(Typers.scala:5301)
at scala.tools.nsc.typechecker.Typers$Typer.typed1(Typers.scala:5587)
at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:5642)
at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:5704)
at scala.tools.nsc.typechecker.Analyzer$typerFactory$$anon$3.apply(Analyzer.scala: 99)
at scala.tools.nsc.Global$GlobalPhase.applyPhase(Global.scala:464)
at scala.tools.nsc.typechecker.Analyzer$typerFactory$$anon$3$$anonfun$run$1.apply( Analyzer.scala:91)
at scala.tools.nsc.typechecker.Analyzer$typerFactory$$anon$3$$anonfun$run$1.apply( Analyzer.scala:91)
at scala.collection.Iterator$class.foreach(Iterator.scala:727)
at scala.collection.AbstractIterator.foreach(Iterator.scala:1157)
at scala.tools.nsc.typechecker.Analyzer$typerFactory$$anon$3.run(Analyzer.scala:91 )
at scala.tools.nsc.Global$Run.compileUnitsInternal(Global.scala:1583)
at scala.tools.nsc.Global$Run.compileUnits(Global.scala:1557)
at scala.tools.nsc.Global$Run.compileSources(Global.scala:1553)
at scala.tools.nsc.Global$Run.compile(Global.scala:1662)
at scala.tools.nsc.Driver.doCompile(Driver.scala:33)
at scala.tools.nsc.Main$.doCompile(Main.scala:79)
at scala.tools.nsc.Driver.process(Driver.scala:54)
at scala.tools.nsc.Driver.main(Driver.scala:67)
at scala.tools.nsc.Main.main(Main.scala)

Exception in thread "main" scala.MatchError: false (of class scala.reflect.internal.Trees$Literal)
at scala.tools.nsc.typechecker.Macros$MacroImplBinding$.unpickleAtom(Macros.scala: 118)
at scala.tools.nsc.typechecker.Macros$MacroImplBinding$$anonfun$6.apply(Macros.sca la:186)
at scala.tools.nsc.typechecker.Macros$MacroImplBinding$$anonfun$6.apply(Macros.sca la:186)
at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:244 )
at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:244 )
at scala.collection.immutable.List.foreach(List.scala:318)
at scala.collection.TraversableLike$class.map(TraversableLike.scala:244)
at scala.collection.AbstractTraversable.map(Traversable.scala:105)
at scala.tools.nsc.typechecker.Macros$MacroImplBinding$.unpickle(Macros.scala:186)
at scala.tools.nsc.typechecker.Macros$class.scala$tools$nsc$typechecker$Macros$$lo adMacroImplBinding(Macros.scala:205)
at scala.tools.nsc.typechecker.Macros$$anonfun$scala$tools$nsc$typechecker$Macros$ $macroRuntime$3.apply(Macros.scala:522)
at scala.tools.nsc.typechecker.Macros$$anonfun$scala$tools$nsc$typechecker$Macros$ $macroRuntime$3.apply(Macros.scala:521)
at scala.collection.mutable.MapLike$class.getOrElseUpdate(MapLike.scala:189)
at scala.collection.mutable.AbstractMap.getOrElseUpdate(Map.scala:91)
at scala.tools.nsc.typechecker.Macros$class.scala$tools$nsc$typechecker$Macros$$ma croRuntime(Macros.scala:521)
at scala.tools.nsc.typechecker.Macros$$anonfun$scala$tools$nsc$typechecker$Macros$ $macroExpand1$1.apply(Macros.scala:795)
at scala.tools.nsc.typechecker.Macros$$anonfun$scala$tools$nsc$typechecker$Macros$ $macroExpand1$1.apply(Macros.scala:787)
at scala.tools.nsc.Global.withInfoLevel(Global.scala:190)
at scala.tools.nsc.typechecker.Macros$class.scala$tools$nsc$typechecker$Macros$$ma croExpand1(Macros.scala:787)
at scala.tools.nsc.typechecker.Macros$class.macroExpand(Macros.scala:701)
at scala.tools.nsc.Global$$anon$1.macroExpand(Global.scala:493)
at scala.tools.nsc.typechecker.Typers$Typer.adapt(Typers.scala:1152)
at scala.tools.nsc.typechecker.Typers$Typer.adapt(Typers.scala:1102)
at scala.tools.nsc.typechecker.Implicits$ImplicitSearch.typedImplicit1(Implicits.s cala:679)
at scala.tools.nsc.typechecker.Implicits$ImplicitSearch.typedImplicit0(Implicits.s cala:631)
at scala.tools.nsc.typechecker.Implicits$ImplicitSearch.pre211DivergenceLogic$1(Im plicits.scala:468)
at scala.tools.nsc.typechecker.Implicits$ImplicitSearch.scala$tools$nsc$typechecke r$Implicits$ImplicitSearch$$typedImplicit(Implicits.scala:499)
at scala.tools.nsc.typechecker.Implicits$ImplicitSearch$ImplicitComputation.pre211 tryImplicitInfo$1(Implicits.scala:932)
at scala.tools.nsc.typechecker.Implicits$ImplicitSearch$ImplicitComputation.rankIm plicits(Implicits.scala:940)
at scala.tools.nsc.typechecker.Implicits$ImplicitSearch$ImplicitComputation.findBe st(Implicits.scala:979)
at scala.tools.nsc.typechecker.Implicits$ImplicitSearch.searchImplicit(Implicits.s cala:1040)
at scala.tools.nsc.typechecker.Implicits$ImplicitSearch.bestImplicit(Implicits.sca la:1427)
at scala.tools.nsc.typechecker.Implicits$class.inferImplicit(Implicits.scala:82)
at scala.tools.nsc.Global$$anon$1.inferImplicit(Global.scala:493)
at scala.tools.nsc.typechecker.Implicits$class.inferImplicit(Implicits.scala:37)
at scala.tools.nsc.Global$$anon$1.inferImplicit(Global.scala:493)
at scala.tools.nsc.typechecker.Typers$Typer.applyImplicitArgs(Typers.scala:127)
at scala.tools.nsc.typechecker.Typers$Typer.adaptToImplicitMethod$1(Typers.scala:8 69)
at scala.tools.nsc.typechecker.Typers$Typer.adapt(Typers.scala:1126)
at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:5660)
at scala.tools.nsc.typechecker.Typers$Typer.typedQualifier(Typers.scala:5727)
at scala.tools.nsc.typechecker.Typers$Typer.typedQualifier(Typers.scala:5735)
at scala.tools.nsc.typechecker.Typers$Typer.adaptToMember(Typers.scala:1349)
at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$18.apply(Typers.scala:1400)
at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$18.apply(Typers.scala:1400)
at scala.tools.nsc.typechecker.Typers$Typer.silent(Typers.scala:745)
at scala.tools.nsc.typechecker.Typers$Typer.adaptToMemberWithArgs(Typers.scala:140 0)
at scala.tools.nsc.typechecker.Typers$Typer.scala$tools$nsc$typechecker$Typers$Typ er$$typedSelect$1(Typers.scala:4793)
at scala.tools.nsc.typechecker.Typers$Typer.typedSelectOrSuperCall$1(Typers.scala: 4933)
at scala.tools.nsc.typechecker.Typers$Typer.typed1(Typers.scala:5563)
at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:5642)
at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$93.apply(Typers.scala:4608)
at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$93.apply(Typers.scala:4608)
at scala.tools.nsc.typechecker.Typers$Typer.silent(Typers.scala:727)
at scala.tools.nsc.typechecker.Typers$Typer.normalTypedApply$1(Typers.scala:4608)
at scala.tools.nsc.typechecker.Typers$Typer.typedApply$1(Typers.scala:4659)
at scala.tools.nsc.typechecker.Typers$Typer.typed1(Typers.scala:5564)
at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:5642)
at scala.tools.nsc.typechecker.Typers$Typer.typedQualifier(Typers.scala:5727)
at scala.tools.nsc.typechecker.Typers$Typer.typedQualifier(Typers.scala:5733)
at scala.tools.nsc.typechecker.Typers$Typer.typedSelectOrSuperCall$1(Typers.scala: 4913)
at scala.tools.nsc.typechecker.Typers$Typer.typed1(Typers.scala:5563)
at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:5642)
at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$93.apply(Typers.scala:4608)
at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$93.apply(Typers.scala:4608)
at scala.tools.nsc.typechecker.Typers$Typer.silent(Typers.scala:727)
at scala.tools.nsc.typechecker.Typers$Typer.normalTypedApply$1(Typers.scala:4608)
at scala.tools.nsc.typechecker.Typers$Typer.typedApply$1(Typers.scala:4659)
at scala.tools.nsc.typechecker.Typers$Typer.typed1(Typers.scala:5564)
at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:5642)
at scala.tools.nsc.typechecker.Typers$Typer.scala$tools$nsc$typechecker$Typers$Typ er$$typedStat$1(Typers.scala:2928)
at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$61.apply(Typers.scala:3032)
at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$61.apply(Typers.scala:3032)
at scala.collection.immutable.List.loop$1(List.scala:170)
at scala.collection.immutable.List.mapConserve(List.scala:186)
at scala.tools.nsc.typechecker.Typers$Typer.typedStats(Typers.scala:3032)
at scala.tools.nsc.typechecker.Typers$Typer.typedTemplate(Typers.scala:1919)
at scala.tools.nsc.typechecker.Typers$Typer.typedClassDef(Typers.scala:1759)
at scala.tools.nsc.typechecker.Typers$Typer.typed1(Typers.scala:5583)
at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:5642)
at scala.tools.nsc.typechecker.Typers$Typer.scala$tools$nsc$typechecker$Typers$Typ er$$typedStat$1(Typers.scala:2928)
at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$61.apply(Typers.scala:3032)
at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$61.apply(Typers.scala:3032)
at scala.collection.immutable.List.loop$1(List.scala:170)
at scala.collection.immutable.List.mapConserve(List.scala:186)
at scala.tools.nsc.typechecker.Typers$Typer.typedStats(Typers.scala:3032)
at scala.tools.nsc.typechecker.Typers$Typer.typedPackageDef$1(Typers.scala:5301)
at scala.tools.nsc.typechecker.Typers$Typer.typed1(Typers.scala:5587)
at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:5642)
at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:5704)
at scala.tools.nsc.typechecker.Analyzer$typerFactory$$anon$3.apply(Analyzer.scala: 99)
at scala.tools.nsc.Global$GlobalPhase.applyPhase(Global.scala:464)
at scala.tools.nsc.typechecker.Analyzer$typerFactory$$anon$3$$anonfun$run$1.apply( Analyzer.scala:91)
at scala.tools.nsc.typechecker.Analyzer$typerFactory$$anon$3$$anonfun$run$1.apply( Analyzer.scala:91)
at scala.collection.Iterator$class.foreach(Iterator.scala:727)
at scala.collection.AbstractIterator.foreach(Iterator.scala:1157)
at scala.tools.nsc.typechecker.Analyzer$typerFactory$$anon$3.run(Analyzer.scala:91 )
at scala.tools.nsc.Global$Run.compileUnitsInternal(Global.scala:1583)
at scala.tools.nsc.Global$Run.compileUnits(Global.scala:1557)
at scala.tools.nsc.Global$Run.compileSources(Global.scala:1553)
at scala.tools.nsc.Global$Run.compile(Global.scala:1662)
at scala.tools.nsc.Driver.doCompile(Driver.scala:33)
at scala.tools.nsc.Main$.doCompile(Main.scala:79)
at scala.tools.nsc.Driver.process(Driver.scala:54)
at scala.tools.nsc.Driver.main(Driver.scala:67)
at scala.tools.nsc.Main.main(Main.scala)

C:\java8\project\scala-test>


David Bess

Posts: 2
Nickname: davidbess
Registered: Apr, 2017

Re: Quick Start Example Compilation Failure Posted: Apr 4, 2017 1:17 PM
Reply to this message Reply
Update:

Changing the jar file to an older version addressed the compilation issue I was facing. The scalatest quick start webpage lead me to believe that using the most recent version was compatible with any version of scala 10+, but it seems like maybe that is not the case. Maybe I was misunderstanding. When I switched to an older jar, namely, scalatest_2.11-2.2.4.jar, compilation is successful. However, I am now facing a runtime error. I am again posting the console input and output below, any help would be greatly appreciated.

--------------------------------------------


C:\java8\project\scala-test> ;dir
Volume in drive C is Windows
Volume Serial Number is D2FA-96C8

Directory of C:\java8\project\scala-test

04/04/2017 01:15 PM <DIR> .
04/04/2017 01:15 PM <DIR> ..
04/04/2017 12:12 PM 522 ExampleSpec.scala
04/04/2017 12:12 PM 11,163,008 scalatest-app_2.11-3.0.1.jar
04/04/2017 01:07 PM 7,185,789 scalatest_2.11-2.2.4.jar
3 File(s) 18,349,319 bytes
2 Dir(s) 101,056,634,880 bytes free

C:\java8\project\scala-test>scalac -cp scalatest_2.11-2.2.4.jar ExampleSpec.scala

C:\java8\project\scala-test>dir
Volume in drive C is Windows
Volume Serial Number is D2FA-96C8

Directory of C:\java8\project\scala-test

04/04/2017 01:16 PM <DIR> .
04/04/2017 01:16 PM <DIR> ..
04/04/2017 01:16 PM 1,726 ExampleSpec$$anonfun$1.class
04/04/2017 01:16 PM 1,191 ExampleSpec$$anonfun$2$$anonfun$apply$mcV$sp$1.class
04/04/2017 01:16 PM 1,818 ExampleSpec$$anonfun$2.class
04/04/2017 01:16 PM 37,661 ExampleSpec.class
04/04/2017 12:12 PM 522 ExampleSpec.scala
04/04/2017 12:12 PM 11,163,008 scalatest-app_2.11-3.0.1.jar
04/04/2017 01:07 PM 7,185,789 scalatest_2.11-2.2.4.jar
7 File(s) 18,391,715 bytes
2 Dir(s) 101,057,646,592 bytes free

C:\java8\project\scala-test>scala -cp scalatest_2.11-2.2.4.jar org.scalatest.run ExampleSpec
An exception or error caused a run to abort. This may have been caused by a problematic custom reporter.
java.lang.NoSuchMethodError: scala.runtime.ObjectRef.create(Ljava/lang/Object;)Lscala/runtime/ObjectRef;
at org.scalatest.tools.Runner$.doRunRunRunDaDoRunRun(Runner.scala:2347)
at org.scalatest.tools.Runner$$anonfun$runOptionallyWithPassFailReporter$2.apply(R unner.scala:1044)
at org.scalatest.tools.Runner$$anonfun$runOptionallyWithPassFailReporter$2.apply(R unner.scala:1043)
at org.scalatest.tools.Runner$.withClassLoaderAndDispatchReporter(Runner.scala:272 2)
at org.scalatest.tools.Runner$.runOptionallyWithPassFailReporter(Runner.scala:1043 )
at org.scalatest.tools.Runner$.main(Runner.scala:860)
at org.scalatest.run$.main(run.scala:120)
at org.scalatest.run.main(run.scala)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.ja va:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at scala.tools.nsc.util.ScalaClassLoader$$anonfun$run$1.apply(ScalaClassLoader.sca la:71)
at scala.tools.nsc.util.ScalaClassLoader$class.asContext(ScalaClassLoader.scala:31 )
at scala.tools.nsc.util.ScalaClassLoader$URLClassLoader.asContext(ScalaClassLoader .scala:139)
at scala.tools.nsc.util.ScalaClassLoader$class.run(ScalaClassLoader.scala:71)
at scala.tools.nsc.util.ScalaClassLoader$URLClassLoader.run(ScalaClassLoader.scala :139)
at scala.tools.nsc.CommonRunner$class.run(ObjectRunner.scala:28)
at scala.tools.nsc.ObjectRunner$.run(ObjectRunner.scala:45)
at scala.tools.nsc.CommonRunner$class.runAndCatch(ObjectRunner.scala:35)
at scala.tools.nsc.ObjectRunner$.runAndCatch(ObjectRunner.scala:45)
at scala.tools.nsc.MainGenericRunner.runTarget$1(MainGenericRunner.scala:74)
at scala.tools.nsc.MainGenericRunner.process(MainGenericRunner.scala:96)
at scala.tools.nsc.MainGenericRunner$.main(MainGenericRunner.scala:105)
at scala.tools.nsc.MainGenericRunner.main(MainGenericRunner.scala)

Flat View: This topic has 1 reply on 1 page
    Next Topic Topic: AsyncFeatureSpec list of Assertions


Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2017 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use - Advertise with Us