diff options
author | Grzegorz Kossakowski <grzegorz.kossakowski@gmail.com> | 2013-01-31 13:48:38 -0800 |
---|---|---|
committer | Grzegorz Kossakowski <grzegorz.kossakowski@gmail.com> | 2013-01-31 13:48:38 -0800 |
commit | d672102fd8bf86fcdb53f1a063072d430d1c1fbb (patch) | |
tree | f242b8143c2a0c191dbfecf4608c298788913d09 /src/reflect | |
parent | 42c4cc7a1eed222a1593c6ac2652cd5357c2897a (diff) | |
parent | fefe6ccc0c47d202156e5e1fc3385b92cbb589a5 (diff) | |
download | scala-d672102fd8bf86fcdb53f1a063072d430d1c1fbb.tar.gz scala-d672102fd8bf86fcdb53f1a063072d430d1c1fbb.tar.bz2 scala-d672102fd8bf86fcdb53f1a063072d430d1c1fbb.zip |
Merge pull request #2021 from gkossakowski/issue/SI-7009
SI-7009: `@throws` annotation synthesized incorrectly
Diffstat (limited to 'src/reflect')
-rw-r--r-- | src/reflect/scala/reflect/internal/Symbols.scala | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/src/reflect/scala/reflect/internal/Symbols.scala b/src/reflect/scala/reflect/internal/Symbols.scala index c1b868f3cb..1dec11548f 100644 --- a/src/reflect/scala/reflect/internal/Symbols.scala +++ b/src/reflect/scala/reflect/internal/Symbols.scala @@ -1583,8 +1583,21 @@ trait Symbols extends api.Symbols { self: SymbolTable => setAnnotations(annot :: annotations) // Convenience for the overwhelmingly common case - def addAnnotation(sym: Symbol, args: Tree*): this.type = + def addAnnotation(sym: Symbol, args: Tree*): this.type = { + // The assertion below is meant to prevent from issues like SI-7009 but it's disabled + // due to problems with cycles while compiling Scala library. It's rather shocking that + // just checking if sym is monomorphic type introduces nasty cycles. We are definitively + // forcing too much because monomorphism is a local property of a type that can be checked + // syntactically + // assert(sym.initialize.isMonomorphicType, sym) addAnnotation(AnnotationInfo(sym.tpe, args.toList, Nil)) + } + + /** Use that variant if you want to pass (for example) an applied type */ + def addAnnotation(tp: Type, args: Tree*): this.type = { + assert(tp.typeParams.isEmpty, tp) + addAnnotation(AnnotationInfo(tp, args.toList, Nil)) + } // ------ comparisons ---------------------------------------------------------------- |