Re: WOD errors

From: Q (qdola..mail.com)
Date: Fri Mar 14 2008 - 05:58:40 EDT

  • Next message: Archibald Singleton: "Missing "Generate Migration0" button in EntityModeler"

    On 14/03/2008, at 5:13 PM, Art Isbell wrote:

    > I believe these WOD errors are new with Eclipse 3.3.2/WOLips 4906,
    > but I'm not certain. I know that the key paths that cause these
    > errors do not result in runtime errors. So the fact that they are
    > flagged as errors at compile time seems bogus. I do not believe
    > that I should have to mark them as "// VALID" to avoid these errors.
    >
    > An app project, whose classes are in the "app" package, depends on
    > a framework, Common.framework, whose classes are in the "common"
    > package. Common.framework depends on a framework,
    > Database.framework, whose classes are in the "database" package. A
    > binding in Bam.wod in the app project is foo.bar.baz. foo is of
    > type app.Foo which extends common.Foo which extends database.Foo
    > which extends database._Foo. foo.bar is defined in database._Foo as
    > a type database._Bar. bar.baz is defined in app.Bar.
    >
    > foo.bar.baz is flagged by WOLips as an error: "There is no key
    > 'baz' for the keypath 'foo.bar' in Bam."
    >
    > If foo.bar.baz were a Java statement in Bam.java, it would have to
    > be written ((Bar)foo.bar()).baz() to avoid a compilation error. But
    > WOLips doesn't seem to be able to figure out that foo.bar.baz will
    > be OK at runtime.

    I think wolips is right in marking this as being unable to validate.
    Your return type for foo.bar() is _Bar, not Bar, so it does not have a
    baz() method. If the only way to access foo.bar().baz() is, as you
    say, with an unsafe type case then you should expect to need to add
    a //VALID statement. Wolips does static analysis using type
    information, if your key path cannot be expressed without type casts
    wolips cannot validate it. That doesn't mean WO can't resolve it at
    runtime, only that it cannot be validated using static analysis.

    > Is there possibly a class path problem that might be causing this?
    > Any other suggestions?

    Use //VALID or change your return type of foo.bar() to Bar instead of
    _Bar

    >
    > Aloha,
    > Art
    >

    -- 
    Seeya...Q
    

    Quinton Dolan - qdola..mail.com Gold Coast, QLD, Australia (GMT+10) Ph: +61 419 729 806



    This archive was generated by hypermail 2.0.0 : Fri Mar 14 2008 - 06:00:09 EDT