diff options
author | Martin Odersky <odersky@gmail.com> | 2008-07-23 14:19:45 +0000 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2008-07-23 14:19:45 +0000 |
commit | 34572d6e7aa24b93a0dba89e214ec2869b44d68c (patch) | |
tree | 0f48e83fbf949da23edbfd457d21e25aa435e048 /src/compiler/scala/tools/nsc/typechecker/Typers.scala | |
parent | 80f341ff128b066edbe5966a26276aa9323b983b (diff) | |
download | scala-34572d6e7aa24b93a0dba89e214ec2869b44d68c.tar.gz scala-34572d6e7aa24b93a0dba89e214ec2869b44d68c.tar.bz2 scala-34572d6e7aa24b93a0dba89e214ec2869b44d68c.zip |
(1) made base type sequences lazy in their argu...
(1) made base type sequences lazy in their arguments. Made
`validateType' in RefChecks more lenient. First shot at allowing
higher-kinded intersection types.
Diffstat (limited to 'src/compiler/scala/tools/nsc/typechecker/Typers.scala')
-rw-r--r-- | src/compiler/scala/tools/nsc/typechecker/Typers.scala | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/compiler/scala/tools/nsc/typechecker/Typers.scala b/src/compiler/scala/tools/nsc/typechecker/Typers.scala index 257461a9cb..6974684ac2 100644 --- a/src/compiler/scala/tools/nsc/typechecker/Typers.scala +++ b/src/compiler/scala/tools/nsc/typechecker/Typers.scala @@ -1147,6 +1147,9 @@ trait Typers { self: Analyzer => /** * @param templ ... * @param parents1 ... + * <li> <!-- 2 --> + * Check that inner classes do not inherit from Annotation + * </li> * @return ... */ def typedTemplate(templ: Template, parents1: List[Tree]): Template = { @@ -1167,6 +1170,8 @@ trait Typers { self: Analyzer => assert(clazz.info.decls != EmptyScope) enterSyms(context.outer.make(templ, clazz, clazz.info.decls), templ.body) validateParentClasses(parents1, selfType) + if ((clazz isSubClass ClassfileAnnotationClass) && !clazz.owner.isPackageClass) + unit.error(clazz.pos, "inner classes cannot be classfile annotations") if (!phase.erasedTypes && !clazz.info.resultType.isError) // @S: prevent crash for duplicated type members checkFinitary(clazz.info.resultType.asInstanceOf[ClassInfoType]) val body = |