final class ScalaInstance(val version: String, val loader: ClassLoader, val loaderCompilerOnly: ClassLoader, val loaderLibraryOnly: ClassLoader, val libraryJars: Array[File], val compilerJars: Array[File], val allJars: Array[File], val explicitActual: Option[String]) extends ScalaInstance
A Scala instance encapsulates all the information that is bound to a concrete Scala version, like the java.lang.ClassLoader or all the JARs required for Scala compilation: library jar, compiler jar and others.
Both a ClassLoader and the jars are required because the compiler's boot classpath requires the location of the library and compiler jar on the classpath to compile any Scala program and macros.
Check whether scalaInstance comes from a managed (i.e. ivy-resolved) scala or if it's a free-floating ScalaInstance, in which case we need to do tricks in the classpaths because it won't be on them.
Check whether scalaInstance comes from a managed (i.e. ivy-resolved) scala or if it's a free-floating ScalaInstance, in which case we need to do tricks in the classpaths because it won't be on them.