-
Notifications
You must be signed in to change notification settings - Fork 12
Tests for 'use type' & 'use all type' clause #160
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yesterday there was some discussion on the default field value not working - not really relevant for this PR, but just wondering if that was resolved or if that's a separate issue we need to address?
pragma Assert (A=1); | ||
|
||
C := Double(B); -- Double is accessible due to 'use all type' clause | ||
-- next statmente would fail as packages do not support function calls atm |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
⛏️ statement
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
-- (NB but not the type itself, this must still be fully qualified | ||
with Count_Types; use type Count_Types.Count; | ||
|
||
-- 'use all type' clause makes visible both the operators and basic operations |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
⛏️ By "basic" operations do you mean primitive operations? That's what they're usually called in Ada related discussions so if that's the case we should use that lingo here as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah yes. Hmm - I think 'basic' would refer to those inherited according to Ada lingo?
Mixup. Fixed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good.
0dd5840
to
a09be5e
Compare
@hannes-steffenhagen-diffblue re "default field value not working" - not an issue here, but will look into that and related as part of a quick familiarisation with our packages support. More tests for edge cases on the way. |
dd6c0ff
to
8b04c3b
Compare
@sonodtt The default field thing isn't really related to packages (or rather: I don't think it is). I think it's just something we don't support for records at the moment. |
4fa9d7e
to
877c89f
Compare
NB our package implementation does not support function calls atm, so although 'use type' can work fully if only built-in operators are used, any use of functions or overloaded operators or new 'basic operations' for a custom type will fail.
877c89f
to
634af76
Compare
NB our package implementation does not support function calls atm, so
although 'use type' can work fully if only built-in operators are used,
any use of functions or overloaded operators or new 'basic operations'
for a custom type will fail.