diff options
author | sheaf <sam.derbyshire@gmail.com> | 2023-02-06 11:37:57 +0100 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2023-02-07 10:51:33 -0500 |
commit | b17fb3d96bd2e9f3bf96392f3b3b3e0aed7fe276 (patch) | |
tree | 7cbe5149ce969707f75e3dfacf8dc350ec69500c /testsuite/tests | |
parent | 3e09cf82ad111e0a6feed81b726849ceaaf3c805 (diff) | |
download | haskell-b17fb3d96bd2e9f3bf96392f3b3b3e0aed7fe276.tar.gz |
Don't allow . in overloaded labels
This patch removes . from the list of allowed characters in a non-quoted
overloaded label, as it was realised this steals syntax, e.g. (#.).
Users who want this functionality will have to add quotes around the
label, e.g. `#"17.28"`.
Fixes #22821
Diffstat (limited to 'testsuite/tests')
-rw-r--r-- | testsuite/tests/overloadedrecflds/should_run/T11671_run.hs | 7 | ||||
-rw-r--r-- | testsuite/tests/printer/Test22771.hs | 7 |
2 files changed, 8 insertions, 6 deletions
diff --git a/testsuite/tests/overloadedrecflds/should_run/T11671_run.hs b/testsuite/tests/overloadedrecflds/should_run/T11671_run.hs index 78ebcdca8e..19a051d0cb 100644 --- a/testsuite/tests/overloadedrecflds/should_run/T11671_run.hs +++ b/testsuite/tests/overloadedrecflds/should_run/T11671_run.hs @@ -12,8 +12,9 @@ import GHC.Prim (Addr#) instance KnownSymbol symbol => IsLabel symbol String where fromLabel = symbolVal (Proxy :: Proxy symbol) -(#) :: String -> Int -> String +(#), (#.) :: String -> Int -> String (#) _ i = show i +_ #. i = show i f :: Addr# -> Int -> String f _ i = show i @@ -26,13 +27,13 @@ main = traverse_ putStrLn , #type , #Foo , #3 - , #199.4 + , #"199.4" , #17a23b , #f'a' , #'a' , #' , #''notTHSplice - , #... + , #"..." , #привет , #こんにちは , #"3" diff --git a/testsuite/tests/printer/Test22771.hs b/testsuite/tests/printer/Test22771.hs index b935a511d0..c711471fb6 100644 --- a/testsuite/tests/printer/Test22771.hs +++ b/testsuite/tests/printer/Test22771.hs @@ -14,8 +14,9 @@ import GHC.Prim (Addr#) instance KnownSymbol symbol => IsLabel symbol String where fromLabel = symbolVal (Proxy :: Proxy symbol) -(#) :: String -> Int -> String +(#), (#.) :: String -> Int -> String (#) _ i = show i +_ #. i = show i f :: Addr# -> Int -> String f _ i = show i @@ -28,13 +29,13 @@ main = traverse_ putStrLn , #type , #Foo , #3 - , #199.4 + , #"199.4" , #17a23b , #f'a' , #'a' , #' , #''notTHSplice - , #... + , #"..." , #привет , #こんにちは , #"3" |