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

Fix #1155 - if without else in expression #1456

Merged
merged 2 commits into from
Aug 11, 2018

Conversation

fdodino
Copy link
Collaborator

@fdodino fdodino commented Aug 10, 2018

Added some tests. It happened to me last year, during revision of students work.

@coveralls
Copy link

coveralls commented Aug 10, 2018

Coverage Status

Coverage increased (+0.004%) to 91.919% when pulling 5b53737 on fix-#1155-ifWithoutElseValidationInExpression into 7acf706 on dev.

@@ -1,5 +1,31 @@
/* XPECT_SETUP org.uqbar.project.wollok.tests.xpect.WollokXPectTest END_SETUP */

object joaquin {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Estas validaciones pronto podrían volverse duplicadas porque el type system debería detectar el mismo problema.
Pero bueno, mientras madura el TS podemos mantenerlas.

Otra es pensar si el TS puede no reportar cosas que podemos validar con métodos más sencillos y rápidos, pero no sé si es fácil.

@@ -624,6 +624,8 @@ class WollokModelExtensions {
def static dispatch expectsExpression(EObject e) { false }
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No para corregir ahora, pero me dejó un warning la semántica de este método porque sólo mira el padre y no la posición del hijo dentro del padre. Por ejemplo, if (b) x exige que b sea una expresión pero no x (y ambos tienen el mismo container. Más complicado aún if (b) x else y podría exigir que x e y sean expresiones dependiendo del contenedor del contenedor, chan.

@fdodino fdodino merged commit bead0f8 into dev Aug 11, 2018
@ghost ghost removed the in progress label Aug 11, 2018
@fdodino fdodino deleted the fix-#1155-ifWithoutElseValidationInExpression branch August 11, 2018 04:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants