Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 19cf3fc

Browse files
committed
Drop the isExplicit type and hasExplicitType logic
1 parent 822277e commit 19cf3fc

File tree

2 files changed

+1
-9
lines changed

2 files changed

+1
-9
lines changed

‎compiler/src/dotty/tools/dotc/core/SymDenotations.scala‎

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2799,9 +2799,6 @@ object SymDenotations {
27992799
/** Sets all missing fields of given denotation */
28002800
def complete(denot: SymDenotation)(using Context): Unit
28012801

2802-
/** Is this a completer for an explicit type tree */
2803-
def isExplicit: Boolean = false
2804-
28052802
def apply(sym: Symbol): LazyType = this
28062803
def apply(module: TermSymbol, modcls: ClassSymbol): LazyType = this
28072804

‎compiler/src/dotty/tools/dotc/typer/Namer.scala‎

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -280,9 +280,6 @@ class Namer { typer: Typer =>
280280
if rhs.isEmpty || flags.is(Opaque) then flags |= Deferred
281281
if flags.is(Param) then tree.rhs else analyzeRHS(tree.rhs)
282282

283-
def hasExplicitType(tree: ValOrDefDef): Boolean =
284-
!tree.tpt.isEmpty || tree.mods.isOneOf(TermParamOrAccessor)
285-
286283
// to complete a constructor, move one context further out -- this
287284
// is the context enclosing the class. Note that the context in which a
288285
// constructor is recorded and the context in which it is completed are
@@ -296,8 +293,6 @@ class Namer { typer: Typer =>
296293

297294
val completer = tree match
298295
case tree: TypeDef => TypeDefCompleter(tree)(cctx)
299-
case tree: ValOrDefDef if Feature.enabled(Feature.modularity) && hasExplicitType(tree) =>
300-
new Completer(tree, isExplicit = true)(cctx)
301296
case _ => Completer(tree)(cctx)
302297
val info = adjustIfModule(completer, tree)
303298
createOrRefine[Symbol](tree, name, flags, ctx.owner, _ => info,
@@ -813,7 +808,7 @@ class Namer { typer: Typer =>
813808
}
814809

815810
/** The completer of a symbol defined by a member def or import (except ClassSymbols) */
816-
class Completer(val original: Tree, overridevalisExplicit:Boolean=false)(ictx: Context) extends LazyType with SymbolLoaders.SecondCompleter {
811+
class Completer(val original: Tree)(ictx: Context) extends LazyType with SymbolLoaders.SecondCompleter {
817812

818813
protected def localContext(owner: Symbol): FreshContext = ctx.fresh.setOwner(owner).setTree(original)
819814

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /