Closed cocreature closed 9 years ago
@edsko Any thoughts on this error? It looks legitimate to me, I'm surprised the code compiles on 7.8 actually.
It looks like it can be fixed by adding a Proxy a
parameter so that it is no longer ambigous.
After doing that ide-backend-common builds fine for me, however ide-backend fails with a (probably) related error
IdeSession/Query.hs:363:57:
Couldn't match expected type ‘XShared a1’
with actual type ‘Private.SpanInfo’
The type variable ‘a1’ is ambiguous
Relevant bindings include
idInfo' :: a1 (bound at IdeSession/Query.hs:363:11)
In the second argument of ‘removeExplicitSharing’, namely ‘idInfo’
In the expression: removeExplicitSharing computedCache idInfo
IdeSession/Query.hs:383:52:
Couldn't match expected type ‘XShared a0’
with actual type ‘Private.ModuleId’
The type variable ‘a0’ is ambiguous
Relevant bindings include
mod' :: a0 (bound at IdeSession/Query.hs:383:9)
In the second argument of ‘removeExplicitSharing’, namely ‘mod’
In the expression: removeExplicitSharing computedCache mod
After adding another Proxy in removeExplicitSharing and changing every call to pass in the Proxy and giving explicit type annotations to the proxy argument at the two error locations, I actually got it to compile. Note: I know very little about type families, so this is probably a terrible solution :) (cabal test seems to be happy)
I'll take a look at this shortly.
We're currently thinking at Well-Typed HQ that this is a regression in the ghc typechecker.. Stay tuned :)
Ok, so I've reported this as a regression in ghc (https://ghc.haskell.org/trac/ghc/ticket/10226). Meanwhile, yes, I think adding some proxies will circumvent the problem. Adding the proxy argument makes the whole MShared
type family redundant, but that doesn't really matter I guess. So if you managed to make this work by adding some proxies, that's fine.
When trying to compile ide-backend-common (which is pulled in as a dependency) I get the following error:
I tried building from git with the same error (I don't think at this point git differs from hackage). I'm using ghc 7.10.1.