Skip to content

0.7.0 - Multi-Symbol Imports

Latest

Choose a tag to compare

@github-actions github-actions released this 22 Jul 09:11

Adds support for importing multiple elements/symbols in one import statement:

import emerge.std.io.{IOException, PrintStream}

It also adds a couple other improvements around imports:

  • if the same element/symbol is imported multiple times, you get an INFO diagnostic
  • if multiple elements/symbols from different packages with identical simple name are imported, you get an ERROR diagnostic
  • if a type reference is ambiguous due to wildcard imports, you get an ERROR diagnostic (before it would just silently resolve to the first type imported)
  • if you declare two global variables with identical names in the same package (and they both have visibility beyond their file), then you get an ERROR diagnostic
  • the ERROR diagnostic around circular variable initialization is now much clearer

Also, some refactorings:

  • BoundBaseType.baseReference got replaced with getBoundReferenceAssertNoTypeParameters(Span) and getBoundReferenceWithNoneOrWildcardTypeArguments(Span). This makes a footgun more obvious and also makes sure these type references have a proper Span wherever possible
  • type inference in BoundVariable was refactored; the data and logic flow is now much more obvious from the code