GHC issueshttps://gitlab.haskell.org/ghc/ghc/-/issues2019-07-07T18:39:05Zhttps://gitlab.haskell.org/ghc/ghc/-/issues/9776-frule-check flag not recognized without parameter2019-07-07T18:39:05ZJan Stolarekjan.stolarek@ed.ac.uk-frule-check flag not recognized without parameter```
$ ghc Foo.hs -frule-check
ghc: on the commandline: unrecognised flag: -frule-check
Usage: For basic information, try the `--help' option.
```
That error message is confusing. `-frule-check` is a valid flag, it's just being used inco...```
$ ghc Foo.hs -frule-check
ghc: on the commandline: unrecognised flag: -frule-check
Usage: For basic information, try the `--help' option.
```
That error message is confusing. `-frule-check` is a valid flag, it's just being used incorrectly. It should be followed by a parameter:
```
$ ghc Foo.hs -frule-check ruleFoo
```
<details><summary>Trac metadata</summary>
| Trac field | Value |
| ---------------------- | ------------ |
| Version | 7.9 |
| Type | Bug |
| TypeOfFailure | OtherFailure |
| Priority | normal |
| Resolution | Unresolved |
| Component | Driver |
| Test case | |
| Differential revisions | |
| BlockedBy | |
| Related | |
| Blocking | |
| CC | |
| Operating system | |
| Architecture | |
</details>
<!-- {"blocked_by":[],"summary":"-frule-check flag not recognized without parameter","status":"New","operating_system":"","component":"Driver","related":[],"milestone":"","resolution":"Unresolved","owner":{"tag":"Unowned"},"version":"7.9","keywords":[],"differentials":[],"test_case":"","architecture":"","cc":[""],"type":"Bug","description":"{{{\r\n$ ghc Foo.hs -frule-check\r\nghc: on the commandline: unrecognised flag: -frule-check\r\nUsage: For basic information, try the `--help' option.\r\n}}}\r\n\r\nThat error message is confusing. `-frule-check` is a valid flag, it's just being used incorrectly. It should be followed by a parameter:\r\n\r\n{{{\r\n$ ghc Foo.hs -frule-check ruleFoo\r\n}}}\r\n","type_of_failure":"OtherFailure","blocking":[]} -->7.10.1carlostomecarlostomehttps://gitlab.haskell.org/ghc/ghc/-/issues/9778Namespace collision detection for promoted types2019-07-07T18:39:05ZEric CrockettNamespace collision detection for promoted typesIn the following example
```hs
{-# LANGUAGE DataKinds #-}
module Foo where
data Nat = Z | S Nat
data S
foo :: S n -> S n
foo = id
```
GHC displays the error
```
Foo.hs:12:8:
‘S’ is applied to too many type arguments
In the...In the following example
```hs
{-# LANGUAGE DataKinds #-}
module Foo where
data Nat = Z | S Nat
data S
foo :: S n -> S n
foo = id
```
GHC displays the error
```
Foo.hs:12:8:
‘S’ is applied to too many type arguments
In the type signature for ‘foo’: foo :: S n -> S n
Failed, modules loaded: none.
```
Of course this code compiles without the definition of `data S`. Without namespace collision detection, it is easy to have working code, and then import a module which breaks the code. For example, I made this request after I imported Module1 with type `S` defined and Module2 with the promoted type `S`, which is what I was trying to use.
Can we get namespace collision detection instead? I'm proposing something like:
```
Foo.hs:9:15
Ambiguous occurence ‘S’
It could refer to either Foo.S defined at Foo.hs:7:1
or to Foo.'S promoted from the constructor defined at Foo.hs:5:16
or to `Bar.'S` promoted from the constructor defined at Bar.hs:line#:char#
or to ...
Use 'S to refer to promoted constructors.
```7.10.1carlostomecarlostome