diff options
author | Jason Zaugg <jzaugg@gmail.com> | 2013-04-09 23:17:18 +0200 |
---|---|---|
committer | Jason Zaugg <jzaugg@gmail.com> | 2013-04-21 13:01:02 +0200 |
commit | 190aea9f015280d0f48cc2928515d11eccce4e33 (patch) | |
tree | 1852a5b8321a0f8ecacb50a7d30e1907f3eb4fbd /src/compiler | |
parent | c9f5ab031a881812149908491217b531b6e29e06 (diff) | |
download | scala-190aea9f015280d0f48cc2928515d11eccce4e33.tar.gz scala-190aea9f015280d0f48cc2928515d11eccce4e33.tar.bz2 scala-190aea9f015280d0f48cc2928515d11eccce4e33.zip |
SI-7345 Exploit named/default args
- Collapse overloads of `rootContext`
- make `atOwner` more concise
Diffstat (limited to 'src/compiler')
-rw-r--r-- | src/compiler/scala/tools/nsc/typechecker/Contexts.scala | 4 | ||||
-rw-r--r-- | src/compiler/scala/tools/nsc/typechecker/Typers.scala | 2 |
2 files changed, 2 insertions, 4 deletions
diff --git a/src/compiler/scala/tools/nsc/typechecker/Contexts.scala b/src/compiler/scala/tools/nsc/typechecker/Contexts.scala index 0a269c6723..22cda50591 100644 --- a/src/compiler/scala/tools/nsc/typechecker/Contexts.scala +++ b/src/compiler/scala/tools/nsc/typechecker/Contexts.scala @@ -86,9 +86,7 @@ trait Contexts { self: Analyzer => else RootImports.completeList } - def rootContext(unit: CompilationUnit): Context = rootContext(unit, EmptyTree, erasedTypes = false) - def rootContext(unit: CompilationUnit, tree: Tree): Context = rootContext(unit, tree, erasedTypes = false) - def rootContext(unit: CompilationUnit, tree: Tree, erasedTypes: Boolean): Context = { + def rootContext(unit: CompilationUnit, tree: Tree = EmptyTree, erasedTypes: Boolean = false): Context = { var sc = startContext for (sym <- rootImports(unit)) { sc = sc.makeNewImport(gen.mkWildcardImport(sym)) diff --git a/src/compiler/scala/tools/nsc/typechecker/Typers.scala b/src/compiler/scala/tools/nsc/typechecker/Typers.scala index 69cd802170..f57352b11e 100644 --- a/src/compiler/scala/tools/nsc/typechecker/Typers.scala +++ b/src/compiler/scala/tools/nsc/typechecker/Typers.scala @@ -5292,7 +5292,7 @@ trait Typers extends Adaptations with Tags { } def atOwner(owner: Symbol): Typer = - newTyper(context.make(context.tree, owner)) + newTyper(context.make(owner = owner)) def atOwner(tree: Tree, owner: Symbol): Typer = newTyper(context.make(tree, owner)) |