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

Validator error for AGREE Enum assignment #124

Closed
janetlj opened this Issue Apr 13, 2018 · 2 comments

Comments

Projects
None yet
2 participants
@janetlj
Copy link

janetlj commented Apr 13, 2018

In OSATE 2.3.2.vfinal version, when doing an assignment from a subcomponent feature of a datatype (e.g., Status_Type in the example below) that extends Enumeration_Type, to a local variable of the same type (e.g., active_status in the example below), the validator flags it as an error for the assignment (e.g., assign active_status = sub_test.active_status; in the example below), saying that the left side of the assignment is of Status_Type, while the right side of the assignment is of Enumeration_Type.

Code example:

data Enumeration_Type
	properties
		Data_Model::Data_Representation => Enum;
end Enumeration_Type;	

data Status_Type extends Enumeration_Type
	properties
		Data_Model::Enumerators => ("INVALID",
					"INPROGRESS", "COMPLETE");			
end Status_Type ;

   system test
       annex agree{**
           eq active_status: Status_Type;
         };
    end test;

    system implementation test.impl
         subcomponents
              sub_test: system sub_test;
          annex agree{**
               assign active_status = sub_test.active_status;
          **};
      end test.impl;

      system sub_test
         features
            active_status: out data port Status_Type;
        end sub_test;

Note: changing the assign active_status = sub_test.active_status; to the following got rid of the validator error:
eq active_status2: Enumeration_Type = sub_test.active_status;

@kfhoech kfhoech self-assigned this Apr 16, 2018

@kfhoech kfhoech added bug AGREE labels Apr 16, 2018

@kfhoech

This comment has been minimized.

Copy link
Contributor

kfhoech commented Apr 16, 2018

Duplicated in develop branch hash e9a3710.

The problem is that at AgreeJavaValidator.java:2696 the evaluation of type chases the type back to the type from which it was extended without regard to whether it is finding the primitive base type of an AADL subcomponent or whether the type is an enumeration type.

@kfhoech

This comment has been minimized.

Copy link
Contributor

kfhoech commented Apr 16, 2018

Resolved by Pull Request.

Thanks, @janetlj for finding this bug!

@kfhoech kfhoech closed this Apr 16, 2018

@kfhoech kfhoech added the v2.3.3 label Jul 11, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.