Fix imports of type operators. #171

Merged
ChickenProp merged 1 commits from fix-type-operator-imports into master 2018-08-19 15:20:06 +02:00
ChickenProp commented 2018-08-10 11:03:44 +02:00 (Migrated from github.com)

Previously, we could only import a type operator with no subsequent list, i.e.

import Foo ( (:.) )

was fine, but

import Foo ( (:.)(..) )
import Foo ( (:.)((:.)) )
import Foo ( (:.)(A, b) )

would all break. Brittany would attempt to output them as

import Foo ( :.(..) )
import Foo ( :.((:.)) )
import Foo ( :.(A, b) )

I believe the problem was that although ieName <$> lie was returning an IEWrappedName with the same contents as used in layoutWrapped, it had different location annotations; and the parentheses are apparently saved in the location annotations.

Closes #170.

Previously, we could only import a type operator with no subsequent list, i.e. ```haskell import Foo ( (:.) ) ``` was fine, but ```haskell import Foo ( (:.)(..) ) import Foo ( (:.)((:.)) ) import Foo ( (:.)(A, b) ) ``` would all break. Brittany would attempt to output them as ```haskell import Foo ( :.(..) ) import Foo ( :.((:.)) ) import Foo ( :.(A, b) ) ``` I believe the problem was that although `ieName <$> lie` was returning an `IEWrappedName` with the same contents as used in `layoutWrapped`, it had different location annotations; and the parentheses are apparently saved in the location annotations. Closes #170.
lspitzner commented 2018-08-19 15:21:00 +02:00 (Migrated from github.com)

Nice catch, thanks!

Nice catch, thanks!
Sign in to join this conversation.
There is no content yet.