I am following along with a lecture, the lecturer is using Eclipse but I am using IntelliJ IDEA Community Edition 15.0.6, and the code on a Scala worksheet named rationals.scala is as follows
object rationals{
val x = new Rational(1,2)
x.numer
x.denom
}
//noinspection ScalaPackageName
class Rational(x: Int, y: Int) {
def numer = x
def denom = y
}
The Scala worksheet worksheet will not compute and there is a warning (not error) associated with the class definition that reads
Package names doesn't correspond to directories structure, this may cause problems with resolve to classes from this file
Also, and this is odd but maybe significant, IDEA flags numer and denom as typos.
Any guidance? thx