Skip to content

$instrs - Couldn't match expected type  #16

@nwtgck

Description

@nwtgck

Hi, developers of llvm-hs-quote

Environment

llvm-hs-quote: 1497273
stack solver: lts-10.3 (this is the same as llvm-hs-quote)

Problem

I'd like use $instrs. However, the following code has a compile error

module11 :: [Either AST.Instruction AST.Terminator] -> AST.Module
module11 instructions = [Quote.LLVM.llmod|
  define void @f() {
  entry:
    $instrs:instructions
    ret void
  }
|]

output

    • Couldn't match expected type ‘Either
                                      AST.Instruction AST.Terminator’
                  with actual type ‘AST.Global.BasicBlock’
    • In the pattern: AST.Global.BasicBlock _ is_an6q t_an6r
      In the pattern: AST.Global.BasicBlock _ is_an6q t_an6r : bbs_an6s
      In a stmt of a 'do' block:
        (AST.Global.BasicBlock _ is_an6q t_an6r : bbs_an6s) <- return
                                                                 (instructions)

If I replaced [Either AST.Instruction AST.Terminator] with [AST.Instruction], the error message looked same like the following.

 Couldn't match expected type ‘AST.Instruction’
                  with actual type ‘AST.Global.BasicBlock’

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions