scala.scalanative.linker

Type members

Classlikes

object ArrayRef
object BoxRef
final class Class(val attrs: Attrs, val name: Top, val parent: Option[Class], val traits: Seq[Trait], val isModule: Boolean)(implicit val position: SourcePosition) extends ScopeInfo
Companion:
object
object Class
Companion:
class
sealed abstract class ClassLoader
Companion:
object
Companion:
class
sealed trait ClassPath
Companion:
object
object ClassPath
Companion:
class
object ClassRef extends Extractor[Class]
trait Extractor[T]
final class Field(val attrs: Attrs, val owner: Info, val name: Member, val isConst: Boolean, val ty: Type, val init: Val)(implicit val position: SourcePosition) extends MemberInfo
object FieldRef extends Extractor[(Info, Field)]
sealed abstract class Info
object Link
final class LinkingException(message: String) extends Exception

Exception that is thrown when a Scala Native linking fails.

Exception that is thrown when a Scala Native linking fails.

sealed abstract class MemberInfo extends Info
final class Method(val attrs: Attrs, val owner: Info, val name: Member, val ty: Function, val insts: Array[Inst], val debugInfo: DebugInfo)(implicit val position: SourcePosition) extends MemberInfo
object MethodRef extends Extractor[(Info, Method)]
Companion:
object
Companion:
class
object Ref extends Extractor[Info]
sealed abstract class ScopeInfo extends Info
object ScopeRef extends Extractor[ScopeInfo]
object Sub

Our subtyping can be described by a following diagram:

Our subtyping can be described by a following diagram:

  value kind        ref kind         special kind
  |     \           |    \
  |     |           |      \
  prim  aggr        class  trait
  |     |           |      /
  |     |           |    /
  |     |           null
  |     |           /
  |     |       /
  |     |   /
  nothing

Primitive and aggregate types don't participate in subtyping and they have to be explicitly boxed to become compatible with a reference type.

Reference types form a simple lattice with java.lang.Object at the top and null type at the bottom. Subtyping between traits and classes is based on linearization of the all transitive parents, similarly to scalac.

Nothing is the common bottom type between reference and value types. It represents computations that may never complete normally (either loops forever or throws an exception).

final class Trait(val attrs: Attrs, val name: Top, val traits: Seq[Trait])(implicit val position: SourcePosition) extends ScopeInfo
object TraitRef extends Extractor[Trait]
final class Unavailable(val name: Global) extends Info
object UnitRef