Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue835 #841

Merged
merged 2 commits into from
Jul 28, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions src/Cryptol/TypeCheck/Type.hs
Original file line number Diff line number Diff line change
Expand Up @@ -834,7 +834,16 @@ instance PP (WithNames Newtype) where




-- | The precedence levels used by this pretty-printing instance
-- correspond with parser non-terminals as follows:
--
-- * 0-1: @type@
--
-- * 2: @infix_type@
--
-- * 3: @app_type@
--
-- * 4: @atype@
instance PP (WithNames Type) where
ppPrec prec ty0@(WithNames ty nmMap) =
case ty of
Expand Down Expand Up @@ -867,7 +876,7 @@ instance PP (WithNames Type) where

(TCTuple _, fs) -> parens $ fsep $ punctuate comma $ map (go 0) fs

(_, _) -> pp tc <+> fsep (map (go 5) ts)
(_, _) -> optParens (prec > 3) $ pp tc <+> fsep (map (go 4) ts)

TCon (PC pc) ts ->
case (pc,ts) of
Expand Down
2 changes: 2 additions & 0 deletions tests/issues/issue835.icry
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
:m Float
:t (zero : Float 5 11) <$ zero
10 changes: 10 additions & 0 deletions tests/issues/issue835.icry.stdout
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
Loading module Cryptol
Loading module Cryptol
Loading module Float

[error] at <interactive>:1:1--1:28:
Unsolved constraints:
• SignedCmp (Float 5 11)
arising from
use of expression (<$)
at <interactive>:1:1--1:28