Commit 4e22d07
committed
Merge branch 'develop-deprecate-arrayAccess'. Close #599.
**Description**
The functions `copilot-language:Copilot.Language.Operators.Array.(.!!)` and
`copilot-libraries:Copilot.Library.Utils.(!!)` were deprecated due to the
introduction of a new, common interface to interact with structures and arrays.
The original functions were deprecated in Copilot 4 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 functions can now be
removed.
**Type**
- Management: remove code deprecated by the introduction of a new feature.
**Additional context**
- Issue #36, addressed in Copilot 4, deprecated the functions.
**Requester**
- Ivan Perez
**Method to check presence of bug**
Not applicable (not a bug).
**Expected result**
Running either of the checks above prints a message indicating that the
functions imported do not exist.
Running either of the checks above prints a message indicating that the
functions imported do not exist. Either of the following should trigger errors:
```
$ runhaskell <<< 'import Copilot.Language.Operators.Array((.!!)); main = return ()'
$ runhaskell <<< 'import Copilot.Library.Utils ((!!)); main = return ()'
```
The following Dockerfile tries to import the deprecated functions, succeeding
only when the import fails, after which prints the message "Success":
```
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**/ \
&& ! cabal v1-exec -- runhaskell <<< 'import Copilot.Language.Operators.Array((.!!)); main = return ()' \
&& ! cabal v1-exec -- runhaskell <<< 'import Copilot.Library.Utils ((!!)); 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-599
```
**Solution implemented**
Remove the deprecated functions
`copilot-language:Copilot.Language.Operators.Array.(.!!)` and
`copilot-libraries:Copilot.Library.Utils.(!!)` , and any references to them.
**Further notes**
None.File tree
5 files changed
+10
-25
lines changed- copilot-language
- src/Copilot/Language/Operators
- copilot-libraries
- src/Copilot/Library
5 files changed
+10
-25
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
3 | 3 | | |
| 4 | + | |
| 5 | + | |
4 | 6 | | |
5 | 7 | | |
6 | 8 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | | - | |
12 | | - | |
| 11 | + | |
13 | 12 | | |
14 | 13 | | |
15 | 14 | | |
| |||
34 | 33 | | |
35 | 34 | | |
36 | 35 | | |
37 | | - | |
38 | | - | |
39 | | - | |
40 | | - | |
41 | | - | |
42 | | - | |
43 | | - | |
44 | | - | |
45 | | - | |
46 | | - | |
47 | | - | |
48 | | - | |
49 | 36 | | |
50 | 37 | | |
51 | 38 | | |
| |||
| 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 | |
|---|---|---|---|
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
26 | | - | |
| 26 | + | |
27 | 27 | | |
28 | 28 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
16 | | - | |
| 16 | + | |
17 | 17 | | |
18 | 18 | | |
19 | | - | |
| 19 | + | |
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
| |||
131 | 131 | | |
132 | 132 | | |
133 | 133 | | |
134 | | - | |
135 | | - | |
136 | | - | |
137 | | - | |
138 | | - | |
139 | | - | |
140 | | - | |
141 | 134 | | |
142 | 135 | | |
143 | 136 | | |
| |||
0 commit comments