Ticket #1316 (new feature request)
add warning for local type signatures that use the same type variable names as outer type signatures
| Reported by: | Isaac Dupree | Owned by: | simonpj |
|---|---|---|---|
| Priority: | normal | Milestone: | _|_ |
| Component: | Compiler | Version: | 6.6.1 |
| Keywords: | Cc: | ||
| Operating System: | Unknown/Multiple | Architecture: | Unknown/Multiple |
| Type of failure: | None/Unknown | Difficulty: | Unknown |
| Test Case: | Blocked By: | ||
| Blocking: | Related Tickets: |
Description
for a (poor) example,
f :: a -> a
f x = x
where
g :: a --this is (forall x. x) not the 'a' from f's type signature
-- So, warn about this signature.
g = undefined
Because it is likely to be confusing, as well as interfering with any possibility of the type variables being considered scoped by default. In fact, this may be a helpful/explanatory message in cases where there will also be a type error due to the type variables not actually being scoped. (although, detecting those cases particularly and giving a recommended solution for how to give such a type signature, would be a more difficult endeavor (what to recommend?))
Change History
Note: See
TracTickets for help on using
tickets.
