agda / agda2hs

Compiling Agda code to readable Haskell

Home Page:https://agda.github.io/agda2hs

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Incorrect compilation of type synonyms

flupe opened this issue · comments

Bug reported by @liesnikov.

private variable @0 a : Set

Ap : (p : @0 a  Set)  @0 a  Set
Ap p x = p x
{-# COMPILE AGDA2HS Ap #-}

Expected output:

type Ap p = p

Actual output:

type Ap x = p

This seems to be happening here:

as <- compileTypeArgs defType namedClausePats

The namedClausePats has both arguments, but the compileDom of the first argument returns DODropped, causing it to be ignored by the compileTypeArgs, whereas it should select the other variable to be DODrpped.