Skip to content
This repository has been archived by the owner on Apr 13, 2019. It is now read-only.

schema language

Konstantin Sobolev edited this page Jun 17, 2016 · 29 revisions

This is a draft page filled as we go with the language implementation

#Imports There are two kinds of imports: namespace imports and single type imports.

Single type import makes one single type from another package available:

import foo.bar.Baz

record R {
  myField: Baz
}

Importing types with the same short name from different namespaces is not allowed:

import foo.bar.Baz
import qux.Baz // clash!

Namespace import brings given namespace into scope, so that namespace prefix can be omitted:

import foo.bar

record R {
  myField: bar.Baz
}

Importing namespaces with the same last segment is not allowed:

import foo.bar
import qux.bar // clash!

Standard imports

The following imports are always implicitly present:

import epigraph.String
import epigraph.Integer
import epigraph.Long
import epigraph.Double
import epigraph.Boolean

Resolution sequence

Type references are resolved in the following order:

  1. Using explicit imports
  2. Using implicit (standard) imports
  3. Types from the same (current) namespace

See [References implementation](References implementation) for more technical details.

Inheritance

Type A inherits type B if they are of the same kind and one of the following is true:

  • A extends B
  • B supplements A
  • A is a member of a vartype V and B supplements V
  • A inherits T, and T inherits B (transitivity)

Polymorphic types

Abstract and final type members

Clone this wiki locally