samedi 12 août 2017

Check the type of an enumerated class

I have an enumerated abstract class:

shared abstract class Foo() of bar|baz {}

And a function that attempts to check if a Foo is not a bar:

shared void test(Foo foo) {
    if (!is bar foo) {

    }
}

I get the error

incorrect syntax: no viable alternative at token 'bar'

Aucun commentaire:

Enregistrer un commentaire