Opened 10 years ago

Last modified 15 months ago

#1318 new feature request

add warning for prefix negate operator and flag to replace it with negative numeric literals

Reported by: Isaac Dupree Owned by:
Priority: normal Milestone:
Component: Compiler (Parser) Version: 6.6.1
Keywords: Cc:
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: Incorrect warning at compile-time Test Case:
Blocked By: Blocking:
Related Tickets: Differential Rev(s):
Wiki Page:

Description

This is tracking a few things relating to the notion that Haskell's single prefix operator, "-", should not exist and "-1" should parse as a single token anyway. See http://thread.gmane.org/gmane.comp.lang.haskell.glasgow.user/11954

If there is a LANGUAGE option for this, what should it be called; and what should the ghc flags be called? Should turning off prefix negation and turning on negative numeric literals be separately controllable? This sort of question (exactly what should be implemented) is probably half the difficulty here.

Change History (5)

comment:1 Changed 10 years ago by Isaac Dupree

Milestone: 6.8_|_
Owner: Isaac Dupree deleted

Work here is pending a specific proposal of what to implement, that there is consensus on. I'm not sure exactly what I want, and (given how my summer is turning out) I'm not really feeling up to making proposals for that. Anyone who wants this pursued further should do so (at which point I might implement that).

Well, there is one thing -fwarn-all-unary-minus that seems straightforward enough, if anyone else hates their semantics as well as syntax that much?

comment:2 Changed 9 years ago by simonmar

Architecture: UnknownUnknown/Multiple

comment:3 Changed 9 years ago by simonmar

Operating System: UnknownUnknown/Multiple

comment:4 Changed 4 years ago by morabbin

Type of failure: None/Unknown

Bump; still of interest?

comment:5 Changed 15 months ago by thomie

Type of failure: None/UnknownIncorrect warning at compile-time
Note: See TracTickets for help on using tickets.