Updates:
        Status: Fixed
        Labels: -Milestone-Release2.11 Milestone-Release2.12

Comment #1 on issue 677 by [email protected]: It's not possible to create fields (THH) that have both custom fieldRead/Show and fieldDefault
http://code.google.com/p/ganeti/issues/detail?id=677

Fixed in:

commit d8adc255312325ec3b23d32487e7fbacbbbb0e8a
Author: Petr Pudlak <[email protected]>
Date:   Thu Jan 16 14:17:14 2014 +0100

    Document Field data type used in TH code generation

    Describe what types of fields are currently possible and allowed and
    what what are the types of their "Q Exp" expressions.

    Signed-off-by: Petr Pudlak <[email protected]>
    Reviewed-by: Klaus Aehlig <[email protected]>

commit 596d7b4f65483bc24db30588ee175a823b0375c4
Author: Petr Pudlak <[email protected]>
Date:   Thu Jan 16 13:37:17 2014 +0100

    Prohibit fields that are optional with a default value

    For fields marked optional we need to keep the information that a value
    isn't available. Therefore having a default value for an optional field
    would not work.

    Signed-off-by: Petr Pudlak <[email protected]>
    Reviewed-by: Klaus Aehlig <[email protected]>

commit ee7caf2736d0cc001c3eab64b26eea04f74afc0d
Author: Petr Pudlak <[email protected]>
Date:   Thu Jan 16 09:29:37 2014 +0100

    A workaround for GHC linking problem "unknown symbol ..."

    GHC 7.4 on Debian Wheezy fails to compile after some TH related changes,
    reporting

      ghc: src/Ganeti/JSON.o: unknown symbol
        `attoparseczm0zi11zi1zi0_DataziAttoparsecziText_zdwf_info`

    This doesn't happen on Squeeze. Explicitly importing attoparsec in THH
    fixes the problem.

    Signed-off-by: Petr Pudlak <[email protected]>
    Reviewed-by: Klaus Aehlig <[email protected]>

commit eb57771676993b83fe2117b6b5d402e027361029
Author: Petr Pudlak <[email protected]>
Date:   Wed Jan 15 16:51:41 2014 +0100

    Fix saveObjectField to work properly with custom fieldShow

    Before it only worked for non-optional fields. For optional fields
    with custom fieldShow functions, the generated code didn't use it.

    Signed-off-by: Petr Pudlak <[email protected]>
    Reviewed-by: Klaus Aehlig <[email protected]>

commit 0b7bf4652adb018d41c41bb5a6d1f428773862f3
Author: Petr Pudlak <[email protected]>
Date:   Tue Jan 14 11:09:27 2014 +0100

    Fix typing problems in TH that generates field code

    See #677: The code generated by TH had different types depending on if
    a field had a default value and/or custom reader. Simple cases worked by
    accident, but more complex ones failed.

    This patch distinguishes properly between optional fields and mandatory
    fields and applies custom field reader functions and default values
    accordingly.

    This also covers the problem fixed in [5b4ed56e].

    Also remove unneeded makeReadOptional. Now that handling optional
    fields is corrected, this helper function is no longer necessary.

    Signed-off-by: Petr Pudlak <[email protected]>
    Reviewed-by: Klaus Aehlig <[email protected]>


--
You received this message because this project is configured to send all issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings

Reply via email to