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

[#68] Add attribute type #71

Merged
merged 5 commits into from Aug 11, 2018
Merged

[#68] Add attribute type #71

merged 5 commits into from Aug 11, 2018

Conversation

grizio
Copy link
Contributor

@grizio grizio commented Aug 11, 2018

This PR give the developer the mean to create a type when creating an attribute.

See commits for more information.

This PR resolves #68.

Gaëtan Rizio added 5 commits August 5, 2018 18:48
To be able to use types in attribute, we must include them into AST.

This commit does the following:

* Add attribute `AttributeDefinition.typeName`
* Update parser to set the value in from Definiti code
* Update json serialization to accept the new attribute
* Add a test to check the presence of the new attribute
* Correct existing tests with an empty `typeName`
Now that we can define an attribute type,
we should be able to reference it for another attribute.

This commit does the following:

* Attribute type references can be a dotted String (ex: "abc.def")
* Attribute types are considered as Simplified alias types
* Imports impact only on the first element of a dotted string
* Add tests verifying that attribute type references can reference another attribute type
* Add a test verifying imports across packages for several levels
With the new feature, we saw that there was no control over parameter types of named functions.
So we add the control in the process.

We also add tests to check the new feature (using attribute types).

This commit does the following:

* Add control `NamedFunctionParameterTypeControl`
* Test nominal cases
* Test the new feature
…comparisons

We check that the new feature behave correctly with comparisons.
To do so, we add tests. The feature is already implemented with previous commit.

We encounter an invalid case in attribute expression typing with the new feature.
We take this opportunity to correct it.

This commit does the following:

* Correct the type of an attribute expression
* Test the new feature for comparisons
…e type name

Each attribute type name must be unique.
So we add a control to ensure it.

This commit does the following:

* Add a control verifying the attribute type name uniqueness
* Add tests verifying the new control
@grizio grizio merged commit c5d0c24 into master Aug 11, 2018
@grizio grizio deleted the 68-attribute-type branch August 11, 2018 08:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Create type when creating attribute
1 participant