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

How to treat parametric types that have no parameters, such as EmitterIO<>? #216

Closed
samreid opened this issue Sep 29, 2020 · 3 comments
Closed

Comments

@samreid
Copy link
Member

samreid commented Sep 29, 2020

From #211, there is a TODO in the IOType constructor:

    // Validate that parametric types look as expected
    // REVIEW: What about EmitterIO<> that has no parameter types?  See https://github.com/phetsims/tandem/issues/211
    // if ( this.typeName.includes( '<' ) ) {
    //   assert && assert( this.parameterTypes.length > 0,
    //     'angle bracket notation is only used for parametric IO Types that have parameter IO Types' );
    // }

Should EmitterIO that emits nothing be a parametric type (like other EmitterIO) or a non-parametric type (since it doesn't emit anything)? I'm uncertain of the assumptions or ramifications for studio. @zepumph can you please make a recommendation?

If necessary, we could change the default for parameterTypes to null (meaning non-parametric) instead of [] (meaning parametric with 0 parameters).

@samreid
Copy link
Member Author

samreid commented Feb 3, 2021

This seems higher than medium priority, and related to #223. Marking "high" until we know more.

@zepumph
Copy link
Member

zepumph commented Feb 11, 2021

I think this is slightly a duplicate of #223. Personally, I don't feel like we need to do anything with this issue. It is more important to me that we make sure that parameterTypes are set correctly, and not that <> are exclusive only to a type with parameters, as it will never be a complete list (like for Function).

Feel free to close this issue if you agree.

@zepumph zepumph assigned samreid and unassigned zepumph Feb 11, 2021
samreid added a commit that referenced this issue Feb 14, 2021
@samreid
Copy link
Member Author

samreid commented Feb 14, 2021

I agree it is perfectly natural to use types like ActionIO<> etc. In the commit, I removed the commented-out code, closing.

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