Commit 59fec12
committed
Merge branch 'develop-remove-UExpr-fields'. Close #636.
**Description**
The record fields `uExprExpr` and `uExprType`, part of `Copilot.Core.Expr`, are
never really used within the module or in any other part of Copilot or, as far
as we know, by any user of Copilot.
The record fields were deprecated in Copilot 4.2 and no messages have been
received requesting that they be kept in this library.
As per our internal policy of waiting 3 versions from deprecation until a
public interface declaration can be removed, these definitions can now be
removed.
**Type**
- Management: remove deprecated code.
**Additional context**
- Issue #565 , addressed in Copilot 4.2, deprecated the definitions.
**Requester**
- Ivan Perez
**Method to check presence of bug**
Not applicable (not a bug).
**Expected result**
Running the check below prints a message indicating that the fields imported
do not exist:
```
$ runhaskell <<< 'import Copilot.Core(uExprType, uExprExpr); main = return ()'
```
The following Dockerfile tries to import the deprecated record fields,
succeeding only when the import fails, after which prints the message
"Success":
```Dockerfile
FROM ubuntu:focal
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update
RUN apt-get install --yes \
libz-dev \
git \
curl \
gcc \
g++ \
make \
libgmp3-dev \
pkg-config \
z3
RUN mkdir -p $HOME/.ghcup/bin
RUN curl https://downloads.haskell.org/~ghcup/0.1.40.0/x86_64-linux-ghcup-0.1.40.0 -o $HOME/.ghcup/bin/ghcup
RUN chmod a+x $HOME/.ghcup/bin/ghcup
ENV PATH=$PATH:/root/.ghcup/bin/
ENV PATH=$PATH:/root/.cabal/bin/
SHELL ["/bin/bash", "-c"]
RUN ghcup install ghc 9.10.1
RUN ghcup install cabal 3.2
RUN ghcup set ghc 9.10.1
RUN cabal update
SHELL ["/bin/bash", "-c"]
CMD git clone $REPO && cd $NAME && git checkout $COMMIT && cd .. \
&& cabal v1-sandbox init \
&& cabal v1-install alex happy --constraint='happy <= 2' \
&& cabal v1-install $NAME/copilot/ \
$NAME/copilot-c99/ \
$NAME/copilot-core/ \
$NAME/copilot-prettyprinter/ \
$NAME/copilot-interpreter/ \
$NAME/copilot-language/ \
$NAME/copilot-libraries/ \
$NAME/copilot-theorem/ \
&& ! cabal v1-exec -- runhaskell <<< 'import Copilot.Core(uExprExpr, uExprType); main = return ()' \
&& echo "Success"
```
Command (substitute variables based on new path after merge):
```
$ docker run -e "REPO=https://github.com/Copilot-Language/copilot" -e "NAME=copilot" -e "COMMIT=<HASH>" -it copilot-verify-636
```
**Solution implemented**
Remove the deprecated definitions `copilot-core:Copilot.Core.Expr.uExprExpr`
and `copilot-core:Copilot.Core.Expr.uExprType`.
**Further notes**
None.2 files changed
+4
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
1 | 4 | | |
2 | 5 | | |
3 | 6 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
67 | 67 | | |
68 | 68 | | |
69 | 69 | | |
70 | | - | |
71 | | - | |
72 | | - | |
73 | | - | |
74 | | - | |
| 70 | + | |
0 commit comments