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

GeneratedEnum and GeneratedOneof extends Product #59

Merged
merged 1 commit into from
Nov 27, 2015

Conversation

xuwei-k
Copy link
Contributor

@xuwei-k xuwei-k commented Nov 27, 2015

before

scala> import com.trueaccord.proto.e2e.one_of.OneofTest
import com.trueaccord.proto.e2e.one_of.OneofTest

scala> List(OneofTest.MyOneOf.Empty, OneofTest.MyOneOf.Sub(OneofTest.SubMessage()))
res0: List[com.trueaccord.proto.e2e.one_of.OneofTest.MyOneOf with Product] = List(Empty, Sub())

scala> import com.trueaccord.proto.e2e.enum3.Color3
import com.trueaccord.proto.e2e.enum3.Color3

scala> Color3.values
res1: Seq[com.trueaccord.proto.e2e.enum3.Color3 with Product] = List(C3_UNKNOWN, C3_RED, C3_GREEN, C3_BLUE)

scala> List(Color3.C3_RED, Color3.C3_BLUE)
res2: List[com.trueaccord.proto.e2e.enum3.Color3 with Product] = List(C3_RED, C3_BLUE)

after

scala> import com.trueaccord.proto.e2e.one_of.OneofTest
import com.trueaccord.proto.e2e.one_of.OneofTest

scala> List(OneofTest.MyOneOf.Empty, OneofTest.MyOneOf.Sub(OneofTest.SubMessage()))
res0: List[com.trueaccord.proto.e2e.one_of.OneofTest.MyOneOf] = List(Empty, Sub())

scala> import com.trueaccord.proto.e2e.enum3.Color3
import com.trueaccord.proto.e2e.enum3.Color3

scala> Color3.values
res1: Seq[com.trueaccord.proto.e2e.enum3.Color3] = List(C3_UNKNOWN, C3_RED, C3_GREEN, C3_BLUE)

scala> List(Color3.C3_RED, Color3.C3_BLUE)
res2: List[com.trueaccord.proto.e2e.enum3.Color3] = List(C3_RED, C3_BLUE)

same fix in Scala std library

before

```
scala> import com.trueaccord.proto.e2e.one_of.OneofTest
import com.trueaccord.proto.e2e.one_of.OneofTest

scala> List(OneofTest.MyOneOf.Empty, OneofTest.MyOneOf.Sub(OneofTest.SubMessage()))
res0: List[com.trueaccord.proto.e2e.one_of.OneofTest.MyOneOf with Product] = List(Empty, Sub())

scala> import com.trueaccord.proto.e2e.enum3.Color3
import com.trueaccord.proto.e2e.enum3.Color3

scala> Color3.values
res1: Seq[com.trueaccord.proto.e2e.enum3.Color3 with Product] = List(C3_UNKNOWN, C3_RED, C3_GREEN, C3_BLUE)

scala> List(Color3.C3_RED, Color3.C3_BLUE)
res2: List[com.trueaccord.proto.e2e.enum3.Color3 with Product] = List(C3_RED, C3_BLUE)
```

after

```
scala> import com.trueaccord.proto.e2e.one_of.OneofTest
import com.trueaccord.proto.e2e.one_of.OneofTest

scala> List(OneofTest.MyOneOf.Empty, OneofTest.MyOneOf.Sub(OneofTest.SubMessage()))
res0: List[com.trueaccord.proto.e2e.one_of.OneofTest.MyOneOf] = List(Empty, Sub())

scala> import com.trueaccord.proto.e2e.enum3.Color3
import com.trueaccord.proto.e2e.enum3.Color3

scala> Color3.values
res1: Seq[com.trueaccord.proto.e2e.enum3.Color3] = List(C3_UNKNOWN, C3_RED, C3_GREEN, C3_BLUE)

scala> List(Color3.C3_RED, Color3.C3_BLUE)
res2: List[com.trueaccord.proto.e2e.enum3.Color3] = List(C3_RED, C3_BLUE)
```

same fix in Scala std library
- scala/scala@da6ef7b7d4cfd4849499e28c7f0f6
- scala/scala@226c4df186150d7773fa7cd9ad68
thesamet added a commit that referenced this pull request Nov 27, 2015
GeneratedEnum and GeneratedOneof extends Product
@thesamet thesamet merged commit 7c3b999 into scalapb:master Nov 27, 2015
@xuwei-k xuwei-k deleted the extends-Product branch November 27, 2015 08:20
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