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

Implicit instantiation of an activity template with type "any" causes exception #79

Closed
seidewitz opened this issue Jul 25, 2019 · 2 comments
Assignees
Labels

Comments

@seidewitz
Copy link
Contributor

It is not normally possible to instantiate a template explicitly using any (i.e, "no type") as the argument for a type parameter. However, if an activity template is implicitly instantiated in an invocation, then it is possible for the implicit template parameter argument to be any. For examaple,

activity A<T>(in x: T[*]) {  }

activity Test() {
    a = null;
    A(a);
}

causes the exception:

Exception in thread "main" java.lang.NullPointerException
	at org.modeldriven.alf.syntax.expressions.impl.QualifiedNameImpl.updateForBinding(QualifiedNameImpl.java:872)
@seidewitz seidewitz added the bug label Jul 25, 2019
@seidewitz seidewitz self-assigned this Jul 25, 2019
@seidewitz
Copy link
Contributor Author

The problem is that QualifiedName.updateForBinding checks if a template argument is null, but it doesn't check whether the argument is any, which is representated by ElementReferenceImpl.any rather than null. This causes the NPR when an attempt is made to get the qualified name of the template argument.

@seidewitz
Copy link
Contributor Author

Resolved in 1.1.0g.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant