diff options
author | schinz <schinz@epfl.ch> | 2003-03-04 13:49:31 +0000 |
---|---|---|
committer | schinz <schinz@epfl.ch> | 2003-03-04 13:49:31 +0000 |
commit | c92e218894312499145816a5ad1f70f042e112b1 (patch) | |
tree | 04328f54a5ebcdbdf29c692a34e92ec0051b8000 | |
parent | 20813b9555655058ecef44ae95018a5382588767 (diff) | |
download | scala-c92e218894312499145816a5ad1f70f042e112b1.tar.gz scala-c92e218894312499145816a5ad1f70f042e112b1.tar.bz2 scala-c92e218894312499145816a5ad1f70f042e112b1.zip |
- bug fix: check that trees actually have a sym...
- bug fix: check that trees actually have a symbol before using it
-rw-r--r-- | sources/scalac/transformer/AddInterfaces.java | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/sources/scalac/transformer/AddInterfaces.java b/sources/scalac/transformer/AddInterfaces.java index 38bc722611..0b17d60f60 100644 --- a/sources/scalac/transformer/AddInterfaces.java +++ b/sources/scalac/transformer/AddInterfaces.java @@ -514,7 +514,7 @@ class AddInterfaces extends SubstTransformer { case Apply(TypeApply(Tree fun, Tree[] targs), Tree[] vargs): { Tree tFun = ((Tree.Apply)newTree).fun; - if (fun.symbol().isPrimaryConstructor()) + if (fun.hasSymbol() && fun.symbol().isPrimaryConstructor()) return copy.Apply(newTree, tFun, vargs) .setType(fixClassSymbols(newTree.type)); else @@ -522,10 +522,8 @@ class AddInterfaces extends SubstTransformer { } case Apply(Tree fun, Tree[] args): { - Symbol sym = fun.symbol(); - - if (sym.isPrimaryConstructor()) { - fun.setSymbol(getClassSym(sym)); + if (fun.hasSymbol() && fun.symbol().isPrimaryConstructor()) { + fun.setSymbol(getClassSym(fun.symbol())); fun.setType(fixClassSymbols(fun.type)); return (copy.Apply(newTree, super.syncTree(fun), args)) .setType(fixClassSymbols(newTree.type)); @@ -534,7 +532,7 @@ class AddInterfaces extends SubstTransformer { } case TypeApply(Tree fun, Tree[] args): { - if (fun.symbol().isPrimaryConstructor()) { + if (fun.hasSymbol() && fun.symbol().isPrimaryConstructor()) { fun.setSymbol(getClassSym(fun.symbol())); fun.setType(fixClassSymbols(fun.type)); return (copy.TypeApply(newTree, super.syncTree(fun), args)) |