Skip to content

CanBuildFrom: Add support for Class and simple form for To (fix #135) #136

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
Aug 6, 2018

Conversation

MasseGuillaume
Copy link
Contributor

No description provided.

@@ -33,4 +33,11 @@ object CanBuildFromSrc {
cbf2("")
()
}

def f2[T, That](implicit cbf: CanBuildFrom[Nothing, T, That]): Foo[T, That] =
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Previously it would only take CanBuildFrom[Nothing, A, CC[B]] now it accepts CanBuildFrom[Nothing, A, B], but it won't rewrite e.to[CC] => cbf.fromSpecific(e)

def f2[T, That](implicit cbf: CanBuildFrom[Nothing, T, That]): Foo[T, That] =
new Foo

class Foo[T, That](implicit cbf: CanBuildFrom[Nothing, T, That]) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

We now support Classes and Def. I don't see another place where we could insert a CanBuildFrom. Maybe on a type alias (type Foo = CanBuildFrom[Bar, Buz, Qux])?

Copy link
Contributor

@julienrf julienrf left a comment

Choose a reason for hiding this comment

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

Awesome!

@julienrf julienrf merged commit 29c3a36 into scala:master Aug 6, 2018
martijnhoekstra pushed a commit to martijnhoekstra/scala-collection-compat that referenced this pull request Nov 9, 2022
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