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

Adding a head to a list can cause an exception during runtime #22

Open
ivardb opened this issue Nov 26, 2021 · 1 comment
Open

Adding a head to a list can cause an exception during runtime #22

ivardb opened this issue Nov 26, 2021 · 1 comment
Assignees
Labels
Prio-Low Low priority Project-Stratego2-Lang Stratego 2 language project State-Open

Comments

@ivardb
Copy link

ivardb commented Nov 26, 2021

Describe the bug
If we have an element of a type A and a list of type B such that A and B share an ancestor adding the element to the head of the list causes an exception during runtime.

Project

Versions
0.16.11

To Reproduce
See: https://gitlab.ewi.tudelft.nl/CS4200/2021-2022/student-icdebruin/-/commit/c1f2695faffa764a174ee644eb3238fa203e5ab0
This commit fixes the bug by adding a type-signature. Without that fix a runtime exception will occur when example.cpyb is converted to an AST

Observed behaviour
Runtime exception

Expected behaviour
The lists type should be converted to a list of the shared ancestor

@Apanatshka
Copy link
Contributor

Hmm, I need to think about whether this is a bug or expected behaviour. Subtyping and gradual types is a confusing combination.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Prio-Low Low priority Project-Stratego2-Lang Stratego 2 language project State-Open
Projects
None yet
Development

No branches or pull requests

2 participants