Skip to content
This repository was archived by the owner on Feb 20, 2019. It is now read-only.

Enable cross compilation #118

Merged
merged 1 commit into from
Apr 10, 2014
Merged

Enable cross compilation #118

merged 1 commit into from
Apr 10, 2014

Conversation

phaller
Copy link
Contributor

@phaller phaller commented Apr 9, 2014

This PR enables the project to build on both Scala 2.10 and 2.11 without changes.

@phaller
Copy link
Contributor Author

phaller commented Apr 9, 2014

Review by @heathermiller

@@ -91,24 +96,9 @@ object Compat {
c.Expr[FastTypeTag[T]](bundle.impl[T])
}

def FastTypeTagMacros_apply(c: Context)(key: c.Expr[String]): c.Expr[FastTypeTag[_]] = {
def FastTypeTagMacros_apply(c: Context)(key: c.Expr[String]): c.Expr[FastTypeTag[t]] forSome { type t } = {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What was wrong here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does not compile on 2.11 otherwise:

[error] .../pickling/core/src/main/scala/pickling/FastTags.scala:58: macro implementation has incompatible shape:
[error]  required: (c: scala.reflect.macros.whitebox.Context)(key: c.Expr[String]): c.Expr[scala.pickling.FastTypeTag[_$7]] forSome { type _$7 }
[error]  or      : (c: scala.reflect.macros.whitebox.Context)(key: c.Tree): c.Tree[]
[error]  found   : (c: reflect.macros.Context)(key: c.Expr[String]): c.Expr[scala.pickling.FastTypeTag[_]]
[error] type mismatch for return type: c.Expr[scala.pickling.FastTypeTag[_]] does not conform to c.Expr[scala.pickling.FastTypeTag[_$7]] forSome { type _$7 }
[error]   def apply(key: String): FastTypeTag[_] = macro Compat.FastTypeTagMacros_apply
[error]                                                         ^
[error] one error found

- uses correct existential in FastTypeTag macro
- adds source compatibility stubs
@phaller
Copy link
Contributor Author

phaller commented Apr 10, 2014

Addressed review comments.

@heathermiller
Copy link
Member

LGTM! Thanks!

heathermiller added a commit that referenced this pull request Apr 10, 2014
@heathermiller heathermiller merged commit 03be7e4 into scala:2.10.x Apr 10, 2014
heathermiller added a commit that referenced this pull request Feb 5, 2015
phaller pushed a commit to phaller/pickling that referenced this pull request Jul 27, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants