diff options
author | Eugene Burmako <xeno.by@gmail.com> | 2012-09-20 10:19:22 -0700 |
---|---|---|
committer | Eugene Burmako <xeno.by@gmail.com> | 2012-09-20 10:19:22 -0700 |
commit | bdae2f2ccd55e91394cdad25e8bf15a225412c82 (patch) | |
tree | c8aa938ccde08f381ee4f7fd8d155ee9f32c19e0 /src/compiler | |
parent | 3136e53e0ce4d73e1d2b3e8d043fff7892b2f439 (diff) | |
parent | 990700039a5972a697471b460c021c5a2d6dbd65 (diff) | |
download | scala-bdae2f2ccd55e91394cdad25e8bf15a225412c82.tar.gz scala-bdae2f2ccd55e91394cdad25e8bf15a225412c82.tar.bz2 scala-bdae2f2ccd55e91394cdad25e8bf15a225412c82.zip |
Merge pull request #1360 from scalamacros/hotfix/sbt
don't try to create tags w/o scala-reflect.jar
Diffstat (limited to 'src/compiler')
-rw-r--r-- | src/compiler/scala/tools/nsc/typechecker/Tags.scala | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/src/compiler/scala/tools/nsc/typechecker/Tags.scala b/src/compiler/scala/tools/nsc/typechecker/Tags.scala index 0dbeafadbe..d82fbd7c77 100644 --- a/src/compiler/scala/tools/nsc/typechecker/Tags.scala +++ b/src/compiler/scala/tools/nsc/typechecker/Tags.scala @@ -59,11 +59,14 @@ trait Tags { * EmptyTree if `concrete` is true and the result contains unresolved (i.e. not spliced) type parameters and abstract type members. * EmptyTree if `allowMaterialization` is false, and there is no array tag in scope. */ - def resolveTypeTag(pos: Position, pre: Type, tp: Type, concrete: Boolean, allowMaterialization: Boolean = true): Tree = { - val tagSym = if (concrete) TypeTagClass else WeakTypeTagClass - val tagTp = if (pre == NoType) TypeRef(ApiUniverseClass.toTypeConstructor, tagSym, List(tp)) else singleType(pre, pre member tagSym.name) - val taggedTp = appliedType(tagTp, List(tp)) - resolveTag(pos, taggedTp, allowMaterialization) - } + def resolveTypeTag(pos: Position, pre: Type, tp: Type, concrete: Boolean, allowMaterialization: Boolean = true): Tree = + // if someone requests a type tag, but scala-reflect.jar isn't on the library classpath, then bail + if (pre == NoType && ApiUniverseClass == NoSymbol) EmptyTree + else { + val tagSym = if (concrete) TypeTagClass else WeakTypeTagClass + val tagTp = if (pre == NoType) TypeRef(ApiUniverseClass.toTypeConstructor, tagSym, List(tp)) else singleType(pre, pre member tagSym.name) + val taggedTp = appliedType(tagTp, List(tp)) + resolveTag(pos, taggedTp, allowMaterialization) + } } }
\ No newline at end of file |