From f920a3186427e9df2fbac97197f2f11331ef4ef3 Mon Sep 17 00:00:00 2001 From: Martin Odersky Date: Fri, 1 Nov 2013 18:26:02 +0100 Subject: Changed handling of signatures in TermRefs. Previously, plain TermRefs had signature NotAMethod. The problem is if the TermRef represents an overloaded term and one of the alternatives is NotAMethod. Then creating the alternative will overwrite (via hash-consing) the overloaded ref. Solution: Introduc new pseudo-signature "UnknownSignature" which is given to plain TermRefs. Also, need to be careful now that all members that denote a specific alternative of a possibly overloaded denotation are referenced by a TermRefWithSig, not a plain TermRef. Previously, implicit members did not follow that, which meant that, what worked, worked only by accident. Still to do: Clean up signatures, termref creation methods. Should TermRef.withDenot automatically set the signature? --- src/dotty/tools/dotc/core/Denotations.scala | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/dotty/tools/dotc/core/Denotations.scala') diff --git a/src/dotty/tools/dotc/core/Denotations.scala b/src/dotty/tools/dotc/core/Denotations.scala index 045f74300..4ab911160 100644 --- a/src/dotty/tools/dotc/core/Denotations.scala +++ b/src/dotty/tools/dotc/core/Denotations.scala @@ -8,7 +8,7 @@ import Names.{Name, PreName} import Names.TypeName import Symbols.NoSymbol import Symbols._ -import Types._, Periods._, Flags._, Transformers._ +import Types._, Periods._, Flags._, Transformers._, Decorators._ import printing.Texts._ import printing.Printer import io.AbstractFile @@ -85,6 +85,8 @@ object Denotations { */ val NotAMethod: Signature = List(Names.EmptyTypeName) + val UnknownSignature: Signature = List(" ".toTypeName) + /** A denotation is the result of resolving * a name (either simple identifier or select) during a given period. * -- cgit v1.2.3