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

No errors for constant property associations #935

Closed
stevevestal opened this issue Nov 9, 2017 · 2 comments
Closed

No errors for constant property associations #935

stevevestal opened this issue Nov 9, 2017 · 2 comments

Comments

@stevevestal
Copy link

OSATE will accept the following declarations. It would seem that either an error would be raised on the first property association that constant is only allowed in property sets; or else an error would be raised in the second that overriding a property earlier declared to be constant is not allowed. (It would actually be nice to do this in some cases. Perhaps the committee might let such a request slip through into AADL 2.3 as an errata.)

system Desired_Component
	properties
		Memory_Size => constant 5 MByte;
end Desired_Component;

system implementation Desired_Component.Provided_Implementation
	properties
		Memory_Size => 10 Mbyte;
end Desired_Component.Provided_Implementation;
@lwrage
Copy link
Contributor

lwrage commented Jul 26, 2018

According to the standard Memory_Size cannot be overwritten in the implementation because it is marked constant in the type. I assume that the same would apply for type extension.
If a contained property association is marked constant it means that there cannot be another contained property association higher up in the containment hierarchy that overrides the property value.

@lwrage
Copy link
Contributor

lwrage commented Aug 11, 2018

We need to add a validation that finds errors when overriding a constant property value that is inherited.
Instantiation needs to check if a contained property association overrides a constant property value. This tracked in a separate issue (#1447).

@lwrage lwrage added in progress and removed next labels Aug 14, 2018
@ghost ghost added review and removed in progress labels Aug 14, 2018
@ghost ghost removed the review label Aug 17, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants