Skip to content

Add error GHC-23482 #521

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions message-index/messages/GHC-23482/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
title: TypeApplication
summary: A type application is only allowed with the TypeApplication extension enabled.
severity: error
introduced: 9.8.1
---

Applying a term to a type (using @ notation) requires enabling the TypeApplication extension.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you please quote the text of the error message somewhere? This would help search engines to find this page.

/tmp/foo.hs:3:5: error:
    Illegal visible type application ‘@Int’
      Perhaps you intended to use TypeApplications
  |
3 | x = read @Int "42"
  |     ^^^^^^^^^

Also it's worth to mention that TypeApplications is implied by GHC2021 / GHC2024 and with modern GHCs one has to specify Haskell2010 explicitly to trigger the error.

4 changes: 4 additions & 0 deletions message-index/messages/GHC-23482/read-int/after/ReadInt.hs
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{-# LANGUAGE TypeApplications #-}
module ReadInt where

x = read @Int "42"
3 changes: 3 additions & 0 deletions message-index/messages/GHC-23482/read-int/before/ReadInt.hs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module ReadInt where

x = read @Int "42"
3 changes: 3 additions & 0 deletions message-index/messages/GHC-23482/read-int/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
title: Using the read function with a type-application
---
Loading