diff options
author | Li Haoyi <haoyi.sg@gmail.com> | 2017-11-26 17:34:37 -0800 |
---|---|---|
committer | Li Haoyi <haoyi.sg@gmail.com> | 2017-11-26 17:34:37 -0800 |
commit | eb0f0a5c4426f218a7f2c4972831a0b3d048e500 (patch) | |
tree | 5a8cf871dd25d5fa83b147620dd8f7b51cdba6fa /core/src/main/scala | |
parent | db5cdae1f80fd89ba87ed397abf08eff8b771469 (diff) | |
download | mill-eb0f0a5c4426f218a7f2c4972831a0b3d048e500.tar.gz mill-eb0f0a5c4426f218a7f2c4972831a0b3d048e500.tar.bz2 mill-eb0f0a5c4426f218a7f2c4972831a0b3d048e500.zip |
Fix error messages on resolving cross-built modules and re-enable relevant neg tests
Diffstat (limited to 'core/src/main/scala')
-rw-r--r-- | core/src/main/scala/mill/Main.scala | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/core/src/main/scala/mill/Main.scala b/core/src/main/scala/mill/Main.scala index 873feed2..1dbae4c3 100644 --- a/core/src/main/scala/mill/Main.scala +++ b/core/src/main/scala/mill/Main.scala @@ -100,7 +100,15 @@ object Main { } case Mirror.Segment.Cross(cross) => - resolve(tail, hierarchy.crossChildren.get._2, obj, rest, remainingCrossSelectors, newRevSelectorsSoFar) + val Some((crossGen, childMirror)) = hierarchy.crossChildren + val crossOptions = crossGen(hierarchy.node(obj, remainingCrossSelectors)) + if (crossOptions.contains(cross)){ + resolve(tail, childMirror, obj, rest, remainingCrossSelectors, newRevSelectorsSoFar) + }else{ + Left("Cannot resolve cross " + renderSelector(newRevSelectorsSoFar.reverse)) + } + + } case Nil => Left("Selector cannot be empty") |