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

[F03] bogus error: Could not resolve generic type bound procedure #533 #849

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

kiranktp
Copy link

@kiranktp kiranktp commented Jan 8, 2020

Earlier a tbp arg was added for few type bound procedure calls (with/without nopass clause).
This was inconsistent. While procedure matching, procedures with nopass clauses were
not considered.
This has been fixed.
Now a tbp arg will be added to all type bound procedure calls and this tbp arg will be
considered/discarded depending on the procedure (with/without nopass clause) being matched.

…ng-compiler#533

Earlier a tbp arg was added for few type bound procedure calls (with/without nopass clause).
This was inconsistent. While procedure matching, procedures with nopass clauses were
not considered.
This has been fixed.
Now a tbp arg will be added to all type bound procedure calls and this tbp arg will be
considered/discarded depending on the procedure (with/without nopass clause) being matched.

Change-Id: I73a1b0c15852b8d2302048d44db4aa26f1f0a9ac
Change-Id: Icc4334dcb22ca0e46b6ece3c651652729505e024
Change-Id: I200132907086a9ca4a6af5fbe26279ce9473f94d
Comment on lines +88 to +91
results(1) = 9 .eq. A%f(10)
results(2) = 99 .eq. A%f1(100)
results(3) = 999 .eq. A%f2(1000)
results(4) = 9999 .eq. A%f3(10000)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can you call the real ones also through the generic name?

Copy link
Author

@kiranktp kiranktp Feb 4, 2020

Choose a reason for hiding this comment

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

I had fogotten to add a check for functions without any parameter. I will add them too.

Copy link
Author

Choose a reason for hiding this comment

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

Can you call the real ones also through the generic name?
Based on the type of the argument passed, the function call gets resolved. What do u mean by calling the real functions thru generic name.? We can always call the actual functions with their names.

Copy link
Collaborator

Choose a reason for hiding this comment

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

I was pointing out that you are calling only the integer ones. Call the real ones also in the test for completeness.

Copy link
Author

Choose a reason for hiding this comment

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

Oops sorry, my bad. Sure I will add the check for real type as well.

Comment on lines 959 to 961
// One tbp argument will be added to a type bound procedure call
// with NOPASS clause.
argno = 1;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is the same change not required in the else portion below?

Can you add a test for operator also?

Copy link
Author

Choose a reason for hiding this comment

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

This check is for generic type bound procedures only, so we do not need this for else part.
I tried to come up with a test case for operator to see if this fix has any side effects but I couldn't.
I also checked if any test case from flang testing infrastructure matches this scenario. none of the tests has the case which enters this piece of code with operator.
This piece of code is being used only by type bound procedures.

Copy link
Author

Choose a reason for hiding this comment

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

I think it is better to restrict this change only to generic type bound procedures. I will do this change and push it for review again.

Change-Id: I2268f5ae7100429b666f561de455eeef2ca32017
Change-Id: Idd1d60a7b3b2761dd36df2a8f60020257e2aedb5
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.

2 participants