Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

template-haskell has no representation for: TyWildCard () Nothing #14

Open
guibou opened this issue Dec 29, 2019 · 0 comments
Open

template-haskell has no representation for: TyWildCard () Nothing #14

guibou opened this issue Dec 29, 2019 · 0 comments
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@guibou
Copy link

guibou commented Dec 29, 2019

This is a similar issue of #4

Converting type application wildcard (such as @_) to template haskell does fails.

How to reproduce:

Prelude> import qualified Language.Haskell.Meta.Syntax.Translate as SyntaxTranslate
Prelude SyntaxTranslate> import qualified Language.Haskell.Exts.Extension as ParseExtension
Prelude SyntaxTranslate ParseExtension> import qualified Language.Haskell.Exts.Parser as ParseExp
Prelude SyntaxTranslate ParseExtension ParseExp>   let parseMode = ParseExp.defaultParseMode { ParseExp.extensions = [ParseExtension.EnableExtension ParseExtension.TypeApplications ] }
Prelude SyntaxTranslate ParseExtension ParseExp> SyntaxTranslate.toExp <$> ParseExp.parseExpWithMode parseMode "show @_ 1"
ParseOk (AppE (AppTypeE (VarE show) *** Exception: Language.Haskell.Meta.Syntax.Translate.toType: template-haskell has no representation for: TyWildCard () Nothing
CallStack (from HasCallStack):
  error, called at src/Language/Haskell/Meta/Syntax/Translate.hs:62:18 in haskell-src-meta-0.8.3-IlZnZ1julhCLgVthcY6pZk:Language.Haskell.Meta.Syntax.Translate

I also tried with haskell-src-meta-0.8.5.

The error is in the following expression:

App (SrcSpanInfo {srcInfoSpan = SrcSpan "<unknown>.hs" 1 1 1 10, srcInfoPoints = []}) (App (SrcSpanInfo {srcInfoSpan = SrcSpan "<unknown>.hs" 1 1 1 8, srcInfoPoints = []}) (Var (SrcSpanInfo {srcInfoSpan = SrcSpan "<unknown>.hs" 1 1 1 5, srcInfoPoints = []}) (UnQual (SrcSpanInfo {srcInfoSpan = SrcSpan "<unknown>.hs" 1 1 1 5, srcInfoPoints = []}) (Ident (SrcSpanInfo {srcInfoSpan = SrcSpan "<unknown>.hs" 1 1 1 5, srcInfoPoints = []}) "show"))) (TypeApp (SrcSpanInfo {srcInfoSpan = SrcSpan "<unknown>.hs" 1 6 1 8, srcInfoPoints = [SrcSpan "<unknown>.hs" 1 6 1 7]}) (TyWildCard (SrcSpanInfo {srcInfoSpan = SrcSpan "<unknown>.hs" 1 7 1 8, srcInfoPoints = []}) Nothing))) (Lit (SrcSpanInfo {srcInfoSpan = SrcSpan "<unknown>.hs" 1 9 1 10, srcInfoPoints = []}) (Int (SrcSpanInfo {srcInfoSpan = SrcSpan "<unknown>.hs" 1 9 1 10, srcInfoPoints = []}) 1 "1"))

Note the TyWildCard constructor which may not be handled.

@bergmark bergmark added help wanted Extra attention is needed enhancement New feature or request labels Jan 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants