diff options
author | Paul Phillips <paulp@improving.org> | 2012-04-25 06:59:27 -0700 |
---|---|---|
committer | Paul Phillips <paulp@improving.org> | 2012-04-25 06:59:27 -0700 |
commit | 5cf9499731255078de62c8f3704fa596b564bf0e (patch) | |
tree | a7a1ed70c8fed20d9900c051540217c2e762963f | |
parent | edc7071d3b284fcf82bd17c7a1cf83f23e32788f (diff) | |
parent | 0a24981d0a71627e541d283b9f739e09a7eab550 (diff) | |
download | scala-5cf9499731255078de62c8f3704fa596b564bf0e.tar.gz scala-5cf9499731255078de62c8f3704fa596b564bf0e.tar.bz2 scala-5cf9499731255078de62c8f3704fa596b564bf0e.zip |
Merge commit 'refs/pull/436/head'
-rw-r--r-- | src/compiler/scala/tools/nsc/typechecker/Macros.scala | 1 | ||||
-rw-r--r-- | test/files/pos/t5706.flags | 1 | ||||
-rw-r--r-- | test/files/pos/t5706.scala | 10 |
3 files changed, 12 insertions, 0 deletions
diff --git a/src/compiler/scala/tools/nsc/typechecker/Macros.scala b/src/compiler/scala/tools/nsc/typechecker/Macros.scala index 4d35549773..ef9bae700e 100644 --- a/src/compiler/scala/tools/nsc/typechecker/Macros.scala +++ b/src/compiler/scala/tools/nsc/typechecker/Macros.scala @@ -388,6 +388,7 @@ trait Macros { self: Analyzer => compatibilityError("types incompatible for parameter "+aparam.name+": corresponding is not a vararg parameter") if (!hasErrors) { var atpe = aparam.tpe.substSym(flatactparams, flatreqparams).instantiateTypeParams(tparams, tvars) + atpe = atpe.dealias // SI-5706 // strip the { type PrefixType = ... } refinement off the Context or otherwise we get compatibility errors atpe = atpe match { case RefinedType(List(tpe), Scope(sym)) if tpe == MacroContextClass.tpe && sym.allOverriddenSymbols.contains(MacroContextPrefixType) => tpe diff --git a/test/files/pos/t5706.flags b/test/files/pos/t5706.flags new file mode 100644 index 0000000000..cd66464f2f --- /dev/null +++ b/test/files/pos/t5706.flags @@ -0,0 +1 @@ +-language:experimental.macros
\ No newline at end of file diff --git a/test/files/pos/t5706.scala b/test/files/pos/t5706.scala new file mode 100644 index 0000000000..847acb693f --- /dev/null +++ b/test/files/pos/t5706.scala @@ -0,0 +1,10 @@ +import scala.reflect.makro.Context + +class Logger { + def error(message: String) = macro Impls.error +} + +object Impls { + type LoggerContext = Context { type PrefixType = Logger } + def error(c: LoggerContext)(message: c.Expr[String]): c.Expr[Unit] = ??? +} |