summaryrefslogtreecommitdiff
path: root/src/compiler/scala/tools/nsc/typechecker/Typers.scala
diff options
context:
space:
mode:
authorLex Spoon <lex@lexspoon.org>2007-01-23 15:34:40 +0000
committerLex Spoon <lex@lexspoon.org>2007-01-23 15:34:40 +0000
commit8acb41bd0a4dc1a6a6e6c20f48cb1c508470551a (patch)
treea65ac192ef81ab0e068e4891654511d5f0ff4982 /src/compiler/scala/tools/nsc/typechecker/Typers.scala
parent76d0d7ad84a236a5b2fb52e83af158b25b817a85 (diff)
downloadscala-8acb41bd0a4dc1a6a6e6c20f48cb1c508470551a.tar.gz
scala-8acb41bd0a4dc1a6a6e6c20f48cb1c508470551a.tar.bz2
scala-8acb41bd0a4dc1a6a6e6c20f48cb1c508470551a.zip
- Added default constructors for Settings and G...
- Added default constructors for Settings and Global - Added attributed types, if -Xplugtypes is available. This enables non-LAMP people to experiment with type attributes. (This is a merge from the plugtypes branch, revision 9679) The attributes are ignored for now, even with -Xplugtypes, but do get propagated.
Diffstat (limited to 'src/compiler/scala/tools/nsc/typechecker/Typers.scala')
-rw-r--r--src/compiler/scala/tools/nsc/typechecker/Typers.scala9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/compiler/scala/tools/nsc/typechecker/Typers.scala b/src/compiler/scala/tools/nsc/typechecker/Typers.scala
index 9faffe5466..aa81ba6de3 100644
--- a/src/compiler/scala/tools/nsc/typechecker/Typers.scala
+++ b/src/compiler/scala/tools/nsc/typechecker/Typers.scala
@@ -2150,6 +2150,11 @@ trait Typers requires Analyzer {
if (value.tag == UnitTag) UnitClass.tpe
else ConstantType(value))
+ case AttributedTypeTree(attribs, tpt) =>
+ attribs.foreach(t => typed(t, EXPRmode, WildcardType))
+ val tptTyped = typed1(tpt, mode, pt)
+ tptTyped setType (tptTyped.tpe.withAttributes(attribs))
+
case SingletonTypeTree(ref) =>
val ref1 = checkStable(typed(ref, EXPRmode | QUALmode, AnyRefClass.tpe))
tree setType ref1.tpe.resultType
@@ -2159,7 +2164,7 @@ trait Typers requires Analyzer {
tree setSymbol sel.symbol setType typedSelect(typedType(qual), selector).tpe
case tree @ CompoundTypeTree(templ: Template) =>
- tree setType {
+ (tree setType {
val parents1 = List.mapConserve(templ.parents)(typedType)
if (parents1 exists (.tpe.isError)) ErrorType
else {
@@ -2168,7 +2173,7 @@ trait Typers requires Analyzer {
newTyper(context.make(templ, self.symbol, decls)).typedRefinement(templ.body)
self
}
- }
+ }) : CompoundTypeTree
case AppliedTypeTree(tpt, args) =>
val tpt1 = typed1(tpt, mode | FUNmode | TAPPmode, WildcardType)