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

Optional type param restriction #2030

Merged
merged 3 commits into from
Sep 27, 2024
Merged

Optional type param restriction #2030

merged 3 commits into from
Sep 27, 2024

Conversation

soutaro
Copy link
Member

@soutaro soutaro commented Sep 27, 2024

Introduce another restriction to default types of generics type parameters. default types cannot depend on optional type params.

# T is required type parameter.
# The default type of S depends on required type parameter => OK
# The default type of U depends on another optional type parameter S => Error
class Foo[T, S = T, U = S?]
end

@soutaro soutaro added this to the RBS 3.6 milestone Sep 27, 2024
@soutaro soutaro added this pull request to the merge queue Sep 27, 2024
Merged via the queue into master with commit 4e5ce53 Sep 27, 2024
19 checks passed
@soutaro soutaro deleted the optional-type-param-limit branch September 27, 2024 08:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

1 participant