ceylon/ceylon-spec — Issue #122: Member aliasing in the import statement
Author: gavinking
Created: 2011-12-26 21:00:41+00:00
State: open
Labels: feature, high priority

In order to support ceylon/ceylon-compiler#301, I propose a new facility for renaming members of a type in the `import` statement. It would look like this for a plain Ceylon type:

import ceylon.language { process { error=writeErrorLine } }

Letting you write:

process.error(...)

For Java interop this needs to support two additional possibilities:

1. support for `static` members:

import java.util { ArrayList, Collections { immutableList } }

Letting you write:

immutableList(ArrayList())

2. support for overloaded members:

import java.io { ByteArrayOutputStream { writeByte = write(Integer), writeByteArray = write(Array) }

Letting you write:

ByteArrayOutputStream().writeByte(2);