uqbar-project / wollok

Wollok Programming Language
GNU General Public License v3.0
60 stars 16 forks source link

[TS] error in simple method delegating a message #1168

Closed javierfernandes closed 7 years ago

javierfernandes commented 7 years ago

Another issue while still trying to find the root cause of the error on my example.. This one seems pretty basic

object booleanConditionError {
    method m() {
        return rules.a()
    }
}
object rules {
    method a() = true
}

This raises the EValidator error. Commenting the m() method declaration makes it work. Also rules.a() gets typed to Any when the TS fails. Is like a failure typing m() makes the whole program to get untyped.

This other syntax also makes it fail

object booleanConditionError {
    method m() = rules.a()
}
javierfernandes commented 7 years ago

Seems like pretty blocker

This also fails

object booleanConditionError {
    method m() {
        return rules.number() > 3
    }
}

And this

object booleanConditionError {
    method m1() = 4 == 3
    method m2() = (4 == 3)
    method m3() { return 4 == 3 }
}
javierfernandes commented 7 years ago

@npasserini showstopper ?

npasserini commented 7 years ago

Easy.

2017-07-28 11:08 GMT-03:00 Javier Fernandes notifications@github.com:

@npasserini https://github.com/npasserini showstopper ?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/uqbar-project/wollok/issues/1168#issuecomment-318661644, or mute the thread https://github.com/notifications/unsubscribe-auth/AEa1Ob_bPjNwFrHYutC5x_FIUpHMJp8Eks5sSetwgaJpZM4Omo4k .

npasserini commented 7 years ago

Fixed in https://github.com/uqbar-project/wollok/pull/1170

javierfernandes commented 7 years ago

This still fails in 1.6.1

class Color {
    const nombre
    constructor(n) { nombre = n }
    method esEstrambotico() { return nombre == "Violeta" }
}

Is not delegating but just comparing a field with a string. I can create a new issue if it is a different case

npasserini commented 7 years ago

Good report, it would be great to create a new issue.

2017-08-01 9:27 GMT-03:00 Javier Fernandes notifications@github.com:

This still fails in 1.6.1

class Color { const nombre constructor(n) { nombre = n } method esEstrambotico() { return nombre == "Violeta" } }

Is not delegating but just comparing a field with a string. I can create a new issue if it is a different case

— You are receiving this because you were assigned. Reply to this email directly, view it on GitHub https://github.com/uqbar-project/wollok/issues/1168#issuecomment-319355650, or mute the thread https://github.com/notifications/unsubscribe-auth/AEa1OZuJovuZUi_ttKmAh3Hx2v7xhnYfks5sTxnHgaJpZM4Omo4k .

javierfernandes commented 7 years ago

I did. Just forget to add here this #1187