Skip to content

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

Merged
merged 1 commit into from
Mar 19, 2019

Conversation

sonodtt
Copy link
Contributor

@sonodtt sonodtt commented Mar 15, 2019

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.

Copy link
Contributor

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

Choose a reason for hiding this comment

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

⛏️ statement

Copy link
Contributor Author

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

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.

Copy link
Contributor Author

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.

Copy link
Contributor

@xbauch xbauch left a comment

Choose a reason for hiding this comment

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

Looks good.

@sonodtt sonodtt force-pushed the use_type_clause branch 2 times, most recently from 0dd5840 to a09be5e Compare March 15, 2019 12:33
@sonodtt
Copy link
Contributor Author

sonodtt commented Mar 15, 2019

@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.

@sonodtt sonodtt force-pushed the use_type_clause branch 4 times, most recently from dd6c0ff to 8b04c3b Compare March 15, 2019 13:45
@hannes-steffenhagen-diffblue
Copy link
Contributor

@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.

@sonodtt sonodtt force-pushed the use_type_clause branch 2 times, most recently from 4fa9d7e to 877c89f Compare March 18, 2019 16:09
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.
@sonodtt sonodtt merged commit 821350a into diffblue:master Mar 19, 2019
@sonodtt sonodtt deleted the use_type_clause branch March 19, 2019 10:01
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