diff options
author | amin <nada.amin@epfl.ch> | 2012-09-18 17:14:30 +0200 |
---|---|---|
committer | amin <nada.amin@epfl.ch> | 2012-09-19 11:43:40 +0200 |
commit | 08e5fd23e73bd2bcccc5f380c0a197d3bb900c02 (patch) | |
tree | ef0f01c94fd2b64e71c8c1c39d33acc8af94a885 /src/compiler/scala/tools/nsc/typechecker/ContextErrors.scala | |
parent | b0a4d536482c6582bafb383a30f553862aceb00f (diff) | |
download | scala-08e5fd23e73bd2bcccc5f380c0a197d3bb900c02.tar.gz scala-08e5fd23e73bd2bcccc5f380c0a197d3bb900c02.tar.bz2 scala-08e5fd23e73bd2bcccc5f380c0a197d3bb900c02.zip |
Fixes SI-6354: improved error messages for Dynamic signature mismatches.
If an error occurs afer a Dynamic rewriting, augment the error message
with the rewritten tree and a hint to check the Dynamic method
signature.
Diffstat (limited to 'src/compiler/scala/tools/nsc/typechecker/ContextErrors.scala')
-rw-r--r-- | src/compiler/scala/tools/nsc/typechecker/ContextErrors.scala | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/compiler/scala/tools/nsc/typechecker/ContextErrors.scala b/src/compiler/scala/tools/nsc/typechecker/ContextErrors.scala index 144cc841b4..e34988af1a 100644 --- a/src/compiler/scala/tools/nsc/typechecker/ContextErrors.scala +++ b/src/compiler/scala/tools/nsc/typechecker/ContextErrors.scala @@ -515,9 +515,16 @@ trait ContextErrors { def ApplyWithoutArgsError(tree: Tree, fun: Tree) = NormalTypeError(tree, fun.tpe+" does not take parameters") + // Dynamic def DynamicVarArgUnsupported(tree: Tree, name: String) = issueNormalTypeError(tree, name+ " does not support passing a vararg parameter") + def DynamicRewriteError(tree: Tree, err: AbsTypeError) = { + issueTypeError(PosAndMsgTypeError(err.errPos, err.errMsg + + s"\nerror after rewriting to $tree\npossible cause: maybe a wrong Dynamic method signature?")) + setError(tree) + } + //checkClassType def TypeNotAStablePrefixError(tpt: Tree, pre: Type) = { issueNormalTypeError(tpt, "type "+pre+" is not a stable prefix") |