diff options
author | Martin Odersky <odersky@gmail.com> | 2016-08-26 18:29:17 +0200 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2016-08-26 18:29:25 +0200 |
commit | 99afc892839ca6209786ccd0dbca2544633be2e8 (patch) | |
tree | d1a48aee4e95bbee6a6399fd7157648572645778 /tests/pos-scala2/i871.scala | |
parent | 1a538af06323f7d6cd471ae0af39842f26e9e7be (diff) | |
download | dotty-99afc892839ca6209786ccd0dbca2544633be2e8.tar.gz dotty-99afc892839ca6209786ccd0dbca2544633be2e8.tar.bz2 dotty-99afc892839ca6209786ccd0dbca2544633be2e8.zip |
Accommodate Scala2 name resolution scheme
Scala2 does not conform to spec Section 2, where it says:
Bindings of different kinds have a precedence defined on them:
1. Definitions and declarations that are local, inherited, or made available by a package clause and also defined in the same compilation unit as the reference, have highest precedence.
2. Explicit imports have next highest precedence.
3. Wildcard imports have next highest precedence.
4. Definitions made available by a package clause, but not also defined in the same compilation unit as the reference, have lowest precedence.
In fact Scala 2, merges (1) and (4) into highest precedence.
This commit simulates the Scala2 behavior under -language:Scala2, but gives a migration
warning. For the naming-resolution test case we get:
dotc *.scala -language:Scala2 -migration
callsite.scala:9: migration warning: Name resolution will change.
currently selected : naming.resolution.Files
in the future, without -language:Scala2: java.nio.file.Files'
where Files is a type in package object package which is an alias of java.util.stream.Stream[java.nio.file.Path]
Files' is a class in package file
def gimmeFiles: Files = Files.list(Paths.get("."))
^
one warning found
Diffstat (limited to 'tests/pos-scala2/i871.scala')
0 files changed, 0 insertions, 0 deletions