Skip to content

Commit

Permalink
[Refactoring] Remove 'UnknownBuiltin' and 'UnknownBuiltinType' (Inter…
Browse files Browse the repository at this point in the history
  • Loading branch information
effectfully authored May 20, 2024
1 parent 1529ef8 commit 9326493
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 7 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
### Removed

- `UnknownBuiltin` and `UnknownBuiltinType` in #6064.
5 changes: 1 addition & 4 deletions plutus-core/plutus-core/src/PlutusCore/Error.hs
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,7 @@ throwingEither r e = case e of

-- | An error encountered during parsing.
data ParserError
= UnknownBuiltinType !T.Text !SourcePos
| BuiltinTypeNotAStar !T.Text !SourcePos
= BuiltinTypeNotAStar !T.Text !SourcePos
| UnknownBuiltinFunction !T.Text !SourcePos ![T.Text]
| InvalidBuiltinConstant !T.Text !T.Text !SourcePos
deriving stock (Eq, Ord, Generic)
Expand Down Expand Up @@ -171,8 +170,6 @@ instance Pretty SourcePos where
pretty = pretty . sourcePosPretty

instance Pretty ParserError where
pretty (UnknownBuiltinType s loc) =
"Unknown built-in type" <+> squotes (pretty s) <+> "at" <+> pretty loc
pretty (BuiltinTypeNotAStar ty loc) =
"Expected a type of kind star (to later parse a constant), but got:" <+>
squotes (pretty ty) <+> "at" <+> pretty loc
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ data MachineError fun
-- ^ A builtin expected a term argument, but something else was received
| UnexpectedBuiltinTermArgumentMachineError
-- ^ A builtin received a term argument when something else was expected
| UnknownBuiltin fun
| NonConstrScrutinized
| MissingCaseBranch Word64
deriving stock (Show, Eq, Functor, Generic)
Expand Down Expand Up @@ -139,8 +138,6 @@ instance (HasPrettyDefaults config ~ 'True, Pretty fun) =>
"A builtin received a term argument when something else was expected"
prettyBy _ (UnliftingMachineError unliftingError) =
pretty unliftingError
prettyBy _ (UnknownBuiltin fun) =
"Encountered an unknown built-in function:" <+> pretty fun
prettyBy _ NonConstrScrutinized =
"A non-constructor value was scrutinized in a case expression"
prettyBy _ (MissingCaseBranch i) =
Expand Down

0 comments on commit 9326493

Please sign in to comment.