summaryrefslogtreecommitdiff
path: root/src/compiler
diff options
context:
space:
mode:
Diffstat (limited to 'src/compiler')
-rw-r--r--src/compiler/scala/tools/nsc/ast/Trees.scala6
-rw-r--r--src/compiler/scala/tools/nsc/models/SemanticTokens.scala3
-rw-r--r--src/compiler/scala/tools/nsc/symtab/IdeSupport.scala8
-rw-r--r--src/compiler/scala/tools/nsc/symtab/SymbolWalker.scala2
-rw-r--r--src/compiler/scala/tools/nsc/typechecker/IdeSupport.scala11
5 files changed, 20 insertions, 10 deletions
diff --git a/src/compiler/scala/tools/nsc/ast/Trees.scala b/src/compiler/scala/tools/nsc/ast/Trees.scala
index 0ad3a5bc8a..d9f6220433 100644
--- a/src/compiler/scala/tools/nsc/ast/Trees.scala
+++ b/src/compiler/scala/tools/nsc/ast/Trees.scala
@@ -207,7 +207,11 @@ trait Trees {
val results = for (i <- 0.until(this0.productArity).toList) yield
equals0(this0.productElement(i), that0.productElement(i))
val b = results.foldLeft(true)((x,y) => x && y)
- b // ignore type!
+ if (b) (this,that) match {
+ case (this0 : TypeTree,that0 : TypeTree) if this0.original != null && that0.original != null =>
+ this0.original.equalsStructure0(that0.original)(f)
+ case _ => true
+ } else false
}
def duplicate: this.type =
diff --git a/src/compiler/scala/tools/nsc/models/SemanticTokens.scala b/src/compiler/scala/tools/nsc/models/SemanticTokens.scala
index 5ebe6510ad..1f246078f4 100644
--- a/src/compiler/scala/tools/nsc/models/SemanticTokens.scala
+++ b/src/compiler/scala/tools/nsc/models/SemanticTokens.scala
@@ -618,7 +618,8 @@ class SemanticTokens(val compiler: Global) {
Console.err.println("LIST =" + this);
Console.err.println("OFFSET=" + offset + " " + tok + " " + tok.length);
Console.err.println(" " + cursor.offset + " " + gap.length);
- throw new Error();
+ gap.length0 = offset - cursor.offset + tok.length
+ //throw new Error();
}
if (offset == cursor.offset) {
// replace or prepend
diff --git a/src/compiler/scala/tools/nsc/symtab/IdeSupport.scala b/src/compiler/scala/tools/nsc/symtab/IdeSupport.scala
index b240fd424c..dd9c529531 100644
--- a/src/compiler/scala/tools/nsc/symtab/IdeSupport.scala
+++ b/src/compiler/scala/tools/nsc/symtab/IdeSupport.scala
@@ -389,8 +389,8 @@ trait IdeSupport extends SymbolTable { // added to global, not analyzers.
}
// because module var shares space with monomorphic.
if (existing.isModuleVar != symbol.isModuleVar) return NotCompatible
- if ((existing.flags|MONOMORPHIC|DEFERRED|ABSTRACT|PRIVATE|PROTECTED|FINAL|SEALED|CASE) !=
- (symbol. flags|MONOMORPHIC|DEFERRED|ABSTRACT|PRIVATE|PROTECTED|FINAL|SEALED|CASE)) {
+ if ((existing.flags|LOCKED|INTERFACE|MONOMORPHIC|DEFERRED|ABSTRACT|PRIVATE|PROTECTED|FINAL|SEALED|CASE) !=
+ (symbol. flags|LOCKED|INTERFACE|MONOMORPHIC|DEFERRED|ABSTRACT|PRIVATE|PROTECTED|FINAL|SEALED|CASE)) {
return NotCompatible
}
if (((existing.flags&(MONOMORPHIC|INTERFACE)) != 0) ||
@@ -406,10 +406,10 @@ trait IdeSupport extends SymbolTable { // added to global, not analyzers.
if (!ret) return NotCompatible
existing.setPos(symbol.pos) // not significant for updating purposes.
if ((existing.privateWithin != symbol.privateWithin ||
- existing.name != symbol.name || ((existing.flags|MONOMORPHIC) != (symbol.flags|MONOMORPHIC)))) {
+ existing.name != symbol.name || ((existing.flags|LOCKED|MONOMORPHIC|INTERFACE) != (symbol.flags|LOCKED|MONOMORPHIC|INTERFACE)))) {
existing.name = (symbol.name)
// don't reset the monomorphic bit until we reset the type.
- existing.flags = symbol.flags | (existing.flags&MONOMORPHIC)
+ existing.flags = symbol.flags
existing.privateWithin = symbol.privateWithin
return new Updated(existing)
}
diff --git a/src/compiler/scala/tools/nsc/symtab/SymbolWalker.scala b/src/compiler/scala/tools/nsc/symtab/SymbolWalker.scala
index e7cf3a20bd..78fd571379 100644
--- a/src/compiler/scala/tools/nsc/symtab/SymbolWalker.scala
+++ b/src/compiler/scala/tools/nsc/symtab/SymbolWalker.scala
@@ -192,9 +192,11 @@ trait SymbolWalker {
f(tree.qualifier)
}
case tree : Literal =>
+ /*
if (tree.tpe != null && tree.tpe.typeSymbol == definitions.ClassClass) {
// nothing we can do without original tree.
}
+ */
case tree : Typed => f(tree.expr); f(tree.tpt)
case tree : Block => fs(tree.stats); f(tree.expr)
diff --git a/src/compiler/scala/tools/nsc/typechecker/IdeSupport.scala b/src/compiler/scala/tools/nsc/typechecker/IdeSupport.scala
index 7b42a4c7c1..97484fbce4 100644
--- a/src/compiler/scala/tools/nsc/typechecker/IdeSupport.scala
+++ b/src/compiler/scala/tools/nsc/typechecker/IdeSupport.scala
@@ -226,7 +226,10 @@ trait IdeSupport extends Analyzer {
else if (namerTxt != NoContext && shouldBeTyped) {} else return fakeUpdate(lastTyped)
val use = useTrees
if (makeNoChanges) {}
- else if (use.isEmpty || use.last.symbol != NoSymbol) return fakeUpdate(use) // already named
+ else if (use.isEmpty || use.last.symbol != NoSymbol) {
+ assert(true)
+ return fakeUpdate(use) // already named
+ }
if (kind.isTop) namer.context.unit.source.file match {
case file : io.PlainFile => reloadSource(file)
@@ -305,16 +308,16 @@ trait IdeSupport extends Analyzer {
// the type changed in a good way.
typeChanged
}
- if (!makeNoChanges && use.length != lastTyped.length || !use.zip(lastTyped).forall{
+ assert(true)
+ if (!makeNoChanges && (use.length != lastTyped.length || !use.zip(lastTyped).forall{
case (t0,t1) => t0.equalsStructure0(t1){
case (t0:StubTree,t1:StubTree) if t0.underlying == t0.underlying || true => true
case _ => false
}
- }) {
+ })) {
assert(true)
highlightChanged
}
-
if (use.last.tpe == null) ErrorType else use.last.tpe
}
}