-
Notifications
You must be signed in to change notification settings - Fork 139
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2470 from AlecsFerra/develop
Fix unsafe data constructor refinements
- Loading branch information
Showing
11 changed files
with
109 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
{-# LANGUAGE GADTs #-} | ||
|
||
-- | Tests that the returned refinement type of data constructors | ||
-- is not allowed to be other than @True@. | ||
module RefCtor where | ||
|
||
import Language.Haskell.Liquid.ProofCombinators | ||
|
||
{-@ type K X Y = { _:F | X = Y } @-} | ||
|
||
data F where | ||
{-@ LIQUID "--expect-error-containing=Refinement of the data constructor RefCtor.MkF doesn't admit an arbitrary refinements on the return type" @-} | ||
{-@ MkF :: x:Int -> y:Int -> K x y @-} | ||
MkF :: Int -> Int -> F | ||
|
||
{-@ falseProof :: { false } @-} | ||
falseProof = () ? MkF 0 2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
{-# LANGUAGE GADTs #-} | ||
|
||
module AllowUnsafeCtor where | ||
|
||
import Language.Haskell.Liquid.ProofCombinators | ||
|
||
{-@ type K X Y = { _:F | X = Y } @-} | ||
|
||
{-@ LIQUID "--allow-unsafe-constructors" @-} | ||
data F where | ||
{-@ MkF :: x:Int -> y:Int -> K x y @-} | ||
MkF :: Int -> Int -> F | ||
|
||
{-@ falseProof :: { false } @-} | ||
falseProof = () ? MkF 0 2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters