[GHC] #15775: Interpreter is treating a comment character as an identifier character.

#15775: Interpreter is treating a comment character as an identifier character. -------------------------------------+------------------------------------- Reporter: philderbeast | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: Component: GHCi | Version: 8.4.3 Keywords: | Operating System: Unknown/Multiple Architecture: | Type of failure: None/Unknown Unknown/Multiple | Test Case: | Blocked By: Blocking: | Related Tickets: Differential Rev(s): | Wiki Page: -------------------------------------+------------------------------------- When bringing dhall-lang up in a REPL I stumbled across a warning about a character in a haddock comment. Should the interpreter be treating a comment character as an identifier character? https://github.com/dhall-lang/dhall- haskell/issues/646#issuecomment-430776320 {{{#!hs {-# LANGUAGE CPP #-} data Expr s a -- | > Combine x y ~ x ∧ y = Combine (Expr s a) (Expr s a) }}} {{{
stack runghc -- --interactive Intersect.hs
Intersect.hs:13:29: error: warning: treating Unicode character as identifier character rather than as '^' symbol [-Wunicode-homoglyph] -- | > Combine x y ~ x ∧ y ^ | 13 | -- | > Combine x y ~ x ∧ y | ^ 1 warning generated.
stack runghc -- --version runghc 8.4.3 }}}
There's a [https://github.com/BlockScope/unicode-homoglyph unicode- homoglyph] repo with the reproduction. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15775 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#15775: Interpreter is treating a comment character as an identifier character. -------------------------------------+------------------------------------- Reporter: philderbeast | Owner: (none) Type: bug | Status: infoneeded Priority: normal | Milestone: Component: GHCi | Version: 8.4.3 Resolution: | Keywords: CPP Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by RyanGlScott): * status: new => infoneeded * keywords: => CPP Comment: It's worth noting that `-Wunicode-homoglyph` is not a GHC warning, but rather a CPP preprocessor warning (`clang`, perhaps?). Moreover, I cannot reproduce this on my machine, which leads to suspect that this is somewhat toolchain-specific. What OS and CPP command are you using? The latter can be found out by looking at the contents of the `${GHC_INSTALLATION_DIR}/lib/ghc-${GHC_VERSION}/settings` file. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15775#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#15775: Interpreter is treating a comment character as an identifier character. -------------------------------------+------------------------------------- Reporter: philderbeast | Owner: (none) Type: bug | Status: infoneeded Priority: normal | Milestone: Component: GHCi | Version: 8.4.3 Resolution: | Keywords: CPP Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by philderbeast): {{{
sw_vers ProductName: Mac OS X ProductVersion: 10.13.6 BuildVersion: 17G65 }}}
-- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15775#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#15775: Interpreter is treating a comment character as an identifier character. ---------------------------------+---------------------------------------- Reporter: philderbeast | Owner: (none) Type: bug | Status: infoneeded Priority: normal | Milestone: Component: GHCi | Version: 8.4.3 Resolution: | Keywords: CPP Operating System: MacOS X | Architecture: Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | ---------------------------------+---------------------------------------- Changes (by philderbeast): * os: Unknown/Multiple => MacOS X -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15775#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#15775: Interpreter is treating a comment character as an identifier character. ---------------------------------+---------------------------------------- Reporter: philderbeast | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: Component: GHCi | Version: 8.4.3 Resolution: | Keywords: CPP Operating System: MacOS X | Architecture: Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | ---------------------------------+---------------------------------------- Changes (by RyanGlScott): * status: infoneeded => new Comment: Indeed, I can reproduce this with `clang-cpp-6.0` on Linux: {{{ $ clang-cpp-6.0 Bug.hs Bug.hs:4:28: warning: treating Unicode character as identifier character rather than as '^' symbol [-Wunicode-homoglyph] -- | > Combine x y ~ x ∧ y ^ # 1 "Bug.hs" # 1 "<built-in>" 1 # 1 "<built-in>" 3 # 349 "<built-in>" 3 # 1 "<command line>" 1 # 1 "<built-in>" 2 # 1 "Bug.hs" 2 {-# LANGUAGE CPP #-} data Expr s a -- | > Combine x y ~ x ∧ y = Combine (Expr s a) (Expr s a) 1 warning generated. $ clang-cpp-6.0 --version clang version 6.0.0-1ubuntu2 (tags/RELEASE_600/final) Target: x86_64-pc-linux-gnu Thread model: posix InstalledDir: /usr/bin }}} -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15775#comment:4 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#15775: Interpreter is treating a comment character as an identifier character. ---------------------------------+---------------------------------------- Reporter: philderbeast | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: Component: GHCi | Version: 8.4.3 Resolution: | Keywords: CPP Operating System: MacOS X | Architecture: Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | ---------------------------------+---------------------------------------- Comment (by bgamari): Oh dear, yet another reason why relying on the system's C preprocessor is a bad idea. More incentive to follow through on #14533. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15775#comment:5 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#15775: Interpreter is treating a comment character as an identifier character. ---------------------------------+---------------------------------------- Reporter: philderbeast | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: Component: GHCi | Version: 8.4.3 Resolution: | Keywords: CPP Operating System: MacOS X | Architecture: Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | ---------------------------------+---------------------------------------- Comment (by potato44): This is/was causing problems for the Agda people too. https://github.com/agda/agda/commit/5ff3fc5155af087c3881915ed82e45c9d06523df -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15775#comment:6 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC