New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Import-renamed method can't be used as partially applied function #7233
Comments
Imported From: https://issues.scala-lang.org/browse/SI-7233?orig=1 |
@retronym said: Looks like an endemic problem: scala> def foo(a: Any) = { import a.{toString => toS}; toS }
unhandled exception while transforming <console>
error: uncaught exception during compilation: scala.reflect.internal.FatalError
scala.reflect.internal.FatalError: class Object does not have a member toS
at scala.reflect.internal.Definitions$DefinitionsClass.scala$reflect$internal$Definitions$DefinitionsClass$$fatalMissingSymbol(Definitions.scala:1028) |
@retronym said: |
@adriaanm said: |
@adriaanm said: commit 632daed4ed
Author: Paul Phillips <paulp@improving.org>
Date: 5 months ago
Minor tweaks in Types/Scopes.
All methods to do with handling imports more uniformly and early
filtering of symbols which cannot be imported. Also make TypeBounds
treat a Wildcard in lower or upper bounds as an empty bound, so we
don't see all these method signatures like
def f[T >: ? <: ?]
because that's not helpful.
diff --git a/src/compiler/scala/tools/nsc/typechecker/Contexts.scala b/src/compiler/scala/tools/nsc/typechecker/Contexts.scala
index dfc621d60e..78380ad054 100644
--- a/src/compiler/scala/tools/nsc/typechecker/Contexts.scala
+++ b/src/compiler/scala/tools/nsc/typechecker/Contexts.scala
@@ -1006,7 +1006,7 @@ trait Contexts { self: Analyzer =>
}
def allImportedSymbols: Iterable[Symbol] =
- qual.tpe.members flatMap (transformImport(tree.selectors, _))
+ importableMembers(qual.tpe) flatMap (transformImport(tree.selectors, _))
|
The following code doesn't compile:
Seems like it should?
The text was updated successfully, but these errors were encountered: