Skip to content

copilot-language: Add type annotation to help type inference engine. Refs #469. #478

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

Conversation

ivanperez-keera
Copy link
Member

Add type signature to an internal definition that uses values of an existential type, making the code for the tests compile with newer versions of GHC (>= 9.4), as required by #469 .

…Refs Copilot-Language#469.

copilot-language's tests fail to compile with GHC 9.4. Prior versions
made some arbitrary decisions during type interfence, and the new type
checker will simply reject such programs.

This commit modifies a function in the tests that uses an existential
type, by adding an explicit type signature. Doing so helps GHC versions
after 9.4 typecheck the code.
@ivanperez-keera
Copy link
Member Author

ivanperez-keera commented Dec 17, 2023

Change Manager: Verified that:

  • Solution is implemented:
    • The code proposed compiles and passes all tests. Details:
      Build log: https://app.travis-ci.com/github/Copilot-Language/copilot/builds/267903584
    • The solution proposed produces the expected result. Details:
      The following Dockerfile checks that copilot-language compiles with GHC 9.4, in which case it prints the message Success:
      FROM ubuntu:focal
      
      RUN apt-get update
      
      RUN apt-get install --yes libz-dev
      RUN apt-get install --yes git
      
      RUN apt-get install --yes wget
      RUN mkdir -p $HOME/.ghcup/bin
      RUN wget https://downloads.haskell.org/~ghcup/0.1.19.2/x86_64-linux-ghcup-0.1.19.2 -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/
      RUN apt-get install --yes curl
      RUN apt-get install --yes gcc make libgmp3-dev g++
      
      SHELL ["/bin/bash", "-c"]
      
      RUN ghcup install ghc 9.4.7
      RUN ghcup install cabal 3.8
      RUN ghcup set ghc 9.4.7
      RUN cabal update
      
      CMD git clone $REPO && \
          cd $NAME && \
          git checkout $COMMIT && \
          cd copilot-language && \
          cabal test . && \
          echo Success
      Command (substitute variables based on new path after merge):
      docker run -e "REPO=https://github.com/ivanperez-keera/copilot" -e "NAME=copilot" -e "COMMIT=e25c7afaf743a5fdc7a9638516f59b006383bef0" -it copilot-verify-469
      
  • Implementation is documented. Details:
    Internal change; no changes to the documentation are needed, and a comment is added to ensure that future revisions do not remove the change accidentally.
  • Change history is clear.
  • Commit messages are clear.
  • Changelogs are updated.
  • Examples are updated. Details:
    No updates needed.
  • Required version bumps are evaluated. Details:
    Bump not needed (internal change to tests; does not affect API).

@ivanperez-keera ivanperez-keera merged commit 60c4484 into Copilot-Language:master Dec 17, 2023
@ivanperez-keera ivanperez-keera deleted the develop-language-test-typeError branch December 17, 2023 19:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

1 participant