Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generate Holder struct in espr #47

Merged
merged 22 commits into from
May 7, 2021
Merged

Generate Holder struct in espr #47

merged 22 commits into from
May 7, 2021

Conversation

termoshtt
Copy link
Contributor

@termoshtt termoshtt commented Apr 29, 2021

Another approach of #45 for #13

TODO

@termoshtt termoshtt self-assigned this Apr 29, 2021
@termoshtt termoshtt added this to the 0.1.0 milestone Apr 29, 2021
@termoshtt termoshtt changed the title Generate Holder struct Generate Holder struct in espr Apr 30, 2021
@termoshtt termoshtt force-pushed the generate-holder-struct branch from 3c95863 to 0138d5b Compare April 30, 2021 14:11
@termoshtt termoshtt force-pushed the generate-holder-struct branch from 0138d5b to 1fadf31 Compare May 3, 2021 02:14
@termoshtt
Copy link
Contributor Author

PlaceHolder requires Clone, which has been dropped in #51.

@termoshtt
Copy link
Contributor Author

termoshtt commented May 4, 2021

For impl Holder we have to check a TypeRef is SimpleType or not, but it is not possible currently due to reference case.

TYPE a = INTEGER; ENDTYPE;
TYPE b = a; ENDTYPE;

In this example, the UnderlyingType of a is UnderlyingType::Simple, and thus we can distinguish it is primitive type. Howerver, it for b is UnderlyingType::Referece, which can be both Simple or not. We have to distinguish in IR level rather than Rust code generation level.

@termoshtt
Copy link
Contributor Author

error[E0599]: the method `into_owned` exists for enum `tables::PlaceHolder<Direction>`, but its trait bounds were not satisfied
    --> ruststep/src/ap201.rs:8613:42
     |
5014 |     pub struct Direction {
     |     --------------------
     |     |
     |     doesn't satisfy `<Direction as tables::Holder>::Owned = _`
     |     doesn't satisfy `Direction: tables::Holder`
...
8613 |                 orientation: orientation.into_owned(tables)?,
     |                                          ^^^^^^^^^^ method cannot be called on `tables::PlaceHolder<Direction>` due to unsatisfied trait bounds
     | 
    ::: ruststep/src/tables.rs:93:1
     |
93   | pub enum PlaceHolder<T> {
     | ----------------------- method `into_owned` not found for this
     |
     = note: the following trait bounds were not satisfied:
             `Direction: tables::Holder`
             `<Direction as tables::Holder>::Owned = _`

still has critical problem. Should split it from this PR

@termoshtt termoshtt marked this pull request as ready for review May 7, 2021 06:14
@termoshtt termoshtt merged commit 9e858a3 into master May 7, 2021
@termoshtt termoshtt deleted the generate-holder-struct branch May 7, 2021 06:15
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.

1 participant