Skip to content

Generate impl EntityTable<XxxAnyHolder>#135

Closed
termoshtt wants to merge 4 commits intomasterfrom
generate-impl-entitytable
Closed

Generate impl EntityTable<XxxAnyHolder>#135
termoshtt wants to merge 4 commits intomasterfrom
generate-impl-entitytable

Conversation

@termoshtt
Copy link
Contributor

@termoshtt termoshtt commented Oct 30, 2021

Resolve #134

@termoshtt termoshtt self-assigned this Oct 30, 2021
This was referenced Oct 30, 2021
@termoshtt termoshtt force-pushed the generate-impl-entitytable branch from a3b99c1 to 8a6d03c Compare October 30, 2021 09:48
@termoshtt termoshtt changed the title Generate impl EntityTable Generate impl EntityTable<XxxAny> in ap201 Oct 30, 2021
@termoshtt
Copy link
Contributor Author

EntityTable in ruststep/test works well. This part has been split into #136, and this PR focus to ap201

@termoshtt termoshtt force-pushed the generate-impl-entitytable branch from 8a6d03c to 99964dc Compare November 8, 2021 06:50
@termoshtt termoshtt changed the title Generate impl EntityTable<XxxAny> in ap201 Generate impl EntityTable<XxxAnyHolder> Nov 9, 2021
@termoshtt termoshtt force-pushed the generate-impl-entitytable branch 3 times, most recently from 2762364 to 3c82996 Compare November 18, 2021 11:24
@termoshtt termoshtt force-pushed the generate-impl-entitytable branch from 3c82996 to 7348021 Compare November 26, 2021 17:33
@termoshtt termoshtt force-pushed the generate-impl-entitytable branch from 7348021 to 8328e8b Compare December 25, 2021 03:22
@termoshtt termoshtt force-pushed the generate-impl-entitytable branch from 8328e8b to a0ce62e Compare December 29, 2021 07:29
@termoshtt
Copy link
Contributor Author


running 2 tests
test get_owned_any ... FAILED
test get_owned ... FAILED

failures:

---- get_owned_any stdout ----
thread 'get_owned_any' panicked at 'called `Result::unwrap()` on an `Err` value: DeserializeFailed("invalid length 3, expected COLOUR_RGB")', ruststep/tests/ap201.rs:14:6
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

---- get_owned stdout ----
thread 'get_owned' panicked at 'called `Result::unwrap()` on an `Err` value: DeserializeFailed("invalid length 3, expected COLOUR_RGB")', ruststep/tests/ap201.rs:14:6


failures:
    get_owned
    get_owned_any

Codes itself has been generated, but it fails deserialize

@termoshtt
Copy link
Contributor Author

Currently, ap201.rs is following:

    #[derive(
        Debug, Clone, PartialEq, :: derive_new :: new, Holder, AsRef, AsMut, Deref, DerefMut,
    )]
    # [holder (table = Tables)]
    # [holder (field = colour_rgb)]
    #[holder(generate_deserialize)]
    pub struct ColourRgb {
        #[as_ref]
        #[as_mut]
        #[deref]
        #[deref_mut]
        #[holder(use_place_holder)]
        pub colour_specification: ColourSpecification,
        pub red: f64,
        pub green: f64,
        pub blue: f64,
    }

this corresponds to its EXPRESS definition:

  ENTITY colour_rgb
    SUBTYPE OF (colour_specification);
      red   : REAL;
      green : REAL;
      blue  : REAL;
    WHERE
      wr1: (0 <= red) AND (red <= 1);
      wr2: (0 <= green) AND (green <= 1);
      wr3: (0 <= blue) AND (blue <= 1);
  END_ENTITY; -- colour_rgb

The error

thread 'get_owned' panicked at 'called `Result::unwrap()` on an `Err` value: DeserializeFailed("invalid length 3, expected COLOUR_RGB")', ruststep/tests/ap201.rs:14:6

is correct, it should be error.

@termoshtt
Copy link
Contributor Author

#134 has been fixed while debugging code generation around Any.

@termoshtt termoshtt closed this Dec 29, 2021
@termoshtt termoshtt deleted the generate-impl-entitytable branch December 29, 2021 08:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

impl EntityTable<XxxAnyHolder> are not generated for ap201

1 participant