diff options
author | Martin Odersky <odersky@gmail.com> | 2004-09-03 13:16:27 +0000 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2004-09-03 13:16:27 +0000 |
commit | 72e388e281b16d3955f13e426b5df7e97f0d8a09 (patch) | |
tree | fcdcbfd8f992d8508a591a80abdada3b7dcb208e | |
parent | 23984e79ff7bae4100d2286df754f3dce5ab3e84 (diff) | |
download | scala-72e388e281b16d3955f13e426b5df7e97f0d8a09.tar.gz scala-72e388e281b16d3955f13e426b5df7e97f0d8a09.tar.bz2 scala-72e388e281b16d3955f13e426b5df7e97f0d8a09.zip |
*** empty log message ***
-rw-r--r-- | doc/reference/ReferencePartAppendix.tex | 2 | ||||
-rw-r--r-- | sources/scala/xml/AttributeSeq.scala | 5 | ||||
-rw-r--r-- | sources/scalac/ast/TreeGen.java | 1 | ||||
-rw-r--r-- | sources/scalac/symtab/Type.java | 15 |
4 files changed, 17 insertions, 6 deletions
diff --git a/doc/reference/ReferencePartAppendix.tex b/doc/reference/ReferencePartAppendix.tex index f5f6a74c78..47087aea5c 100644 --- a/doc/reference/ReferencePartAppendix.tex +++ b/doc/reference/ReferencePartAppendix.tex @@ -192,7 +192,7 @@ grammar. TmplDef ::= ([case] class | trait) ClassDef | [case] object ObjectDef ClassDef ::= ClassSig {`,' ClassSig} [`:' SimpleType] ClassTemplate - ClassSig ::= id [TypeParamClause] [ParamClause] + ClassSig ::= id [TypeParamClause] [ClassParamClause] ObjectDef ::= id {`,' id} [`:' SimpleType] ClassTemplate ClassTemplate ::= extends Template diff --git a/sources/scala/xml/AttributeSeq.scala b/sources/scala/xml/AttributeSeq.scala index bb74a053d7..c04c96aa42 100644 --- a/sources/scala/xml/AttributeSeq.scala +++ b/sources/scala/xml/AttributeSeq.scala @@ -26,7 +26,7 @@ object AttributeSeq { }:_* ) } - /** construct from a map, fixing namespaces to ns + /** construct from a map, fixing namespacePs to ns * each Attribute with an empty namespace will get the namespace ns. * @param ns the namespace to use instead of the empty one * @param as a map from Pair(uri,key) to value @@ -66,7 +66,8 @@ object AttributeSeq { var ts = new TreeSet[Attribute]; for( val a <- as ) { if( a.key != "xmlns" ) { - val url = if( a.namespace.length() == 0) ns else a.namespace; + var url: String = _; + if ( a.namespace.length() == 0) url = ns else url = a.namespace; ts = ts + Attribute(url,a.key,a.value) ; } } diff --git a/sources/scalac/ast/TreeGen.java b/sources/scalac/ast/TreeGen.java index bf481e1b39..e077413b3b 100644 --- a/sources/scalac/ast/TreeGen.java +++ b/sources/scalac/ast/TreeGen.java @@ -747,6 +747,7 @@ public class TreeGen implements Kinds, Modifiers, TypeTags { /** Builds an If node with given components and type. */ public If If(int pos, Tree cond, Tree thenpart, Tree elsepart, Type type) { + //if (!thenpart.type.isSubType(type)) System.out.println(type + "!>:(" + thenpart.type + "," + elsepart.type + ")");//debug assert assertTreeSubTypeOf(thenpart, type); assert assertTreeSubTypeOf(elsepart, type); If tree = make.If(pos, cond, thenpart, elsepart); diff --git a/sources/scalac/symtab/Type.java b/sources/scalac/symtab/Type.java index ff3e25e84f..5901fc75fa 100644 --- a/sources/scalac/symtab/Type.java +++ b/sources/scalac/symtab/Type.java @@ -2171,7 +2171,10 @@ public class Type implements Modifiers, Kinds, TypeTags, EntryTags { this.singleDeref().isSameAs(that) || that.singleDeref().isSingletonType() && - this.isSameAs(that.singleDeref()); + this.isSameAs(that.singleDeref()) + || + deAlias(that) != that && + this.isSameAs(deAlias(that)); default: if (deAlias(this) != this) return deAlias(this).isSameAs(that); @@ -2187,7 +2190,10 @@ public class Type implements Modifiers, Kinds, TypeTags, EntryTags { this.singleDeref().isSameAs(that) || that.singleDeref().isSingletonType() && - this.isSameAs(that.singleDeref()); + this.isSameAs(that.singleDeref()) + || + (deAlias(this) != this || deAlias(that) != that) && + deAlias(this).isSameAs(deAlias(that)); case ThisType(Symbol sym1): return sym.isModule() && sym.moduleClass() == sym1 @@ -2197,7 +2203,10 @@ public class Type implements Modifiers, Kinds, TypeTags, EntryTags { this.singleDeref().isSameAs(that) || that.singleDeref().isSingletonType() && - this.isSameAs(that.singleDeref()); + this.isSameAs(that.singleDeref()) + || + deAlias(this) != this && + deAlias(this).isSameAs(that); default: if (deAlias(this) != this) return deAlias(this).isSameAs(that); |