summaryrefslogtreecommitdiff
path: root/testsuite/tests/safeHaskell/overlapping
Commit message (Collapse)AuthorAgeFilesLines
* Mention which -Werror promoted a warning to an errorÖmer Sinan Ağacan2017-07-111-4/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously -Werror or -Werror=flag printed warnings as usual and then printed these two lines: <no location info>: error: Failing due to -Werror. This is not ideal: first, it's not clear which flag made one of the warnings an error. Second, warning messages are not modified in any way, so there's no way to know which warnings caused this error. With this patch we (1) promote warning messages to error messages if a relevant -Werror is enabled (2) mention which -Werror is used during this promotion. Previously: [1 of 1] Compiling Main ( test.hs, test.o ) test.hs:9:10: warning: [-Wincomplete-patterns] Pattern match(es) are non-exhaustive In a case alternative: Patterns not matched: (C2 _) | 9 | sInt s = case s of | ^^^^^^^^^... test.hs:12:14: warning: [-Wmissing-fields] • Fields of ‘Rec’ not initialised: f2 • In the first argument of ‘print’, namely ‘Rec {f1 = 1}’ In the expression: print Rec {f1 = 1} In an equation for ‘main’: main = print Rec {f1 = 1} | 12 | main = print Rec{ f1 = 1 } | ^^^^^^^^^^^^^ <no location info>: error: Failing due to -Werror. Now: [1 of 1] Compiling Main ( test.hs, test.o ) test.hs:9:10: error: [-Wincomplete-patterns, -Werror=incomplete-patterns] Pattern match(es) are non-exhaustive In a case alternative: Patterns not matched: (C2 _) | 9 | sInt s = case s of | ^^^^^^^^^... test.hs:12:14: error: [-Wmissing-fields, -Werror=missing-fields] • Fields of ‘Rec’ not initialised: f2 • In the first argument of ‘print’, namely ‘Rec {f1 = 1}’ In the expression: print Rec {f1 = 1} In an equation for ‘main’: main = print Rec {f1 = 1} | 12 | main = print Rec{ f1 = 1 } | ^^^^^^^^^^^^^ Test Plan: - Update old tests, add new tests if there aren't any relevant tests Reviewers: austin, bgamari Reviewed By: bgamari Subscribers: rwbarton, thomie Differential Revision: https://phabricator.haskell.org/D3709
* Typos in manual and commentsGabor Greif2017-03-141-1/+1
|
* Typos and grammar in manual/commentsGabor Greif2017-01-231-1/+1
|
* Remove clean_cmd and extra_clean usage from .T filesThomas Miedema2017-01-221-53/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | The `clean_cmd` and `extra_clean` setup functions don't do anything. Remove them from .T files. Created using https://github.com/thomie/refactor-ghc-testsuite. This diff is a test for the .T-file parser/processor/pretty-printer in that repository. find . -name '*.T' -exec ~/refactor-ghc-testsuite/Main "{}" \; Tests containing inline comments or multiline strings are not modified. Preparation for #12223. Test Plan: Harbormaster Reviewers: austin, hvr, simonmar, mpickering, bgamari Reviewed By: mpickering Subscribers: mpickering Differential Revision: https://phabricator.haskell.org/D3000 GHC Trac Issues: #12223
* Replace -fshow-source-paths with -fhide-source-pathsSylvain Henry2016-11-2911-32/+32
| | | | | | | | | | | | | | | | | | | | | This patch reverts the change introduced with 587dcccfdfa7a319e27300a4f3885071060b1f8e and restores the previous default output of GHC (i.e., show source path and object path for each compiled module). The -fhide-source-paths flag can be used to hide these paths and reduce the line noise. Reviewers: gracjan, nomeata, austin, bgamari, simonmar, hvr Reviewed By: hvr Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D2728 GHC Trac Issues: #12851
* Make default output less verbose (source/object paths)Sylvain HENRY2016-11-1111-32/+32
| | | | | | | | | | | | Reviewers: simonmar, mpickering, austin, bgamari Reviewed By: bgamari Subscribers: mpickering, nomeata, thomie Differential Revision: https://phabricator.haskell.org/D2679 GHC Trac Issues: #12807
* Print which flag controls emitted SafeHaskell warningsHerbert Valerio Riedel2016-02-272-22/+24
| | | | | | | This is extends bb5afd3c274011c5ea302210b4c290ec1f83209c to cover SafeHaskell warnings. This implements yet another part of #10752
* New handling of overlapping inst in Safe HaskellDavid Terei2015-05-1145-0/+593
We do much better now due to the newish per-instance flags. Rather than mark any module that uses `-XOverlappingInstances`, `-XIncoherentInstances` or the new `OVERLAP*` pragmas as unsafe, we regard them all as safe and defer the check until an overlap occurs. An type-class method call that involves overlapping instances is considered _unsafe_ when: 1) The most specific instance, Ix, is from a module marked `-XSafe` 2) Ix is an orphan instance or a MPTC 3) At least one instance that Ix overlaps, Iy, is: a) from a different module than Ix AND b) Iy is not marked `OVERLAPPABLE` This check is only enforced in modules compiled with `-XSafe` or `-XTrustworthy`. This fixes Safe Haskell to work with the latest overlapping instance pragmas, and also brings consistent behavior. Previously, Safe Inferred modules behaved differently than `-XSafe` modules.