Skip to content

ApiAnnotations : Nested forall loses forall annotation

When parsing

{-# LANGUAGE ScopedTypeVariables #-}

extremumNewton :: forall tag. forall tag1.
                   tag -> tag1 -> Int
extremumNewton = undefined

The parser attaches an AnnForall to the second forall, which appears as a nested HsForAllTy.

Somewhere this nesting is flattened, and the tyvarbndrs are collapsed into a single HsForAllTy. In this process the second AnnForAll loses its anchor in the AST.

Trac metadata
Trac field Value
Version 7.10.1
Type Bug
TypeOfFailure OtherFailure
Priority normal
Resolution Unresolved
Component Compiler (Parser)
Test case
Differential revisions
BlockedBy
Related
Blocking
CC mpickering
Operating system
Architecture
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information