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

[GAIAPLAT-794] Variable hides tag should cause an error #894

Merged
merged 2 commits into from
Aug 31, 2021

Conversation

simone-gaia
Copy link
Contributor

No description provided.

{
// https://gaiaplatform.atlassian.net/browse/GAIAPLAT-1178
// TODO: this works and does not produce any warning.
int i = 0;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It could require some time to make an error here.... If we consider it important for preview I can try to do it.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this give a warning?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nope.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's just add a jira item for V1 and press on.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's right above :) (GAIAPLAT-1178)

Copy link
Contributor

@LaurentiuCristofor LaurentiuCristofor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, but I'm not the expert in this area.

@@ -9619,6 +9619,9 @@ def err_parameter_names_numbers_different_from_parameter: Error<
def err_table_not_found : Error<
"Table '%0' was not found in the catalog. "
"Ensure that the table you are referencing in your rule exists in the database.">;
def err_tag_hidden : Error<
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about warn_field_hidden and warn_table_hidden? Should we also promote these to errors instead of warnings? I do think, however, that warn_able_referenced_not_in_table_attribute is an appropriate warning.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch, I haven't noticed them. Let me try to understand what they do.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, it seems they should stay warnings (waiting for your approval though). These are examples that trigger the warnings. Basically, they hide things in the catalog that you can access either way using the explicit syntax (sensor->incubator, sensor.value).

ruleset test
{
    on_insert(sensor)
    {
        int incubator = 5; // warn_table_hidden
    }
}
ruleset test
{
    on_update(sensor)
    {
        if (sensor.value == 5)
        {
            int value = 5;  // warn_field_hidden
        }
    }
}

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay - I'm fine keeping these as warnings. Thanks for looking into it.

@simone-gaia simone-gaia merged commit 61a5b53 into master Aug 31, 2021
@LaurentiuCristofor LaurentiuCristofor deleted the rondelli-tags-redefinition branch October 15, 2021 20: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.

3 participants