-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Properly display value of value class in repl #15545
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
Changes from 1 commit
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
b767dab
fix repl to properly display value of value class after it's creation
rochala 5715012
use toString to display value of value class in repl
rochala 81d4712
remove toString call
rochala 8b135ad
change value class check to existing method, add tests for special chars
rochala 23a89e5
add test
rochala File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,107 @@ | ||
scala> class NInt(val x: Int) extends AnyVal | ||
// defined class NInt | ||
|
||
scala> NInt(23) | ||
val res0: NInt = NInt@17 | ||
|
||
scala> res0.toString | ||
val res1: String = NInt@17 | ||
|
||
scala> 23 | ||
val res2: Int = 23 | ||
|
||
scala> class NBoolean(val x: Boolean) extends AnyVal | ||
// defined class NBoolean | ||
|
||
scala> NBoolean(true) | ||
val res3: NBoolean = NBoolean@4cf | ||
|
||
scala> res3.toString | ||
val res4: String = NBoolean@4cf | ||
|
||
scala> true | ||
val res5: Boolean = true | ||
|
||
scala> class NByte(val x: Byte) extends AnyVal | ||
// defined class NByte | ||
|
||
scala> NByte(1) | ||
val res6: NByte = NByte@1 | ||
|
||
scala> res6.toString | ||
val res7: String = NByte@1 | ||
|
||
scala> val res8: Byte = 1 | ||
val res8: Byte = 1 | ||
|
||
scala> class NShort(val x: Short) extends AnyVal | ||
// defined class NShort | ||
|
||
scala> NShort(1) | ||
val res9: NShort = NShort@1 | ||
|
||
scala> res9.toString | ||
val res10: String = NShort@1 | ||
|
||
scala> val res11: Short = 1 | ||
val res11: Short = 1 | ||
|
||
scala> class NLong(val x: Long) extends AnyVal | ||
// defined class NLong | ||
|
||
scala> NLong(1) | ||
val res12: NLong = NLong@1 | ||
|
||
scala> res12.toString | ||
val res13: String = NLong@1 | ||
|
||
scala> 1L | ||
val res14: Long = 1 | ||
|
||
scala> class NFloat(val x: Float) extends AnyVal | ||
// defined class NFloat | ||
|
||
scala> NFloat(1L) | ||
val res15: NFloat = NFloat@3f800000 | ||
|
||
scala> res15.toString | ||
val res16: String = NFloat@3f800000 | ||
|
||
scala> 1.0F | ||
val res17: Float = 1.0 | ||
|
||
scala> class NDouble(val x: Double) extends AnyVal | ||
// defined class NDouble | ||
|
||
scala> NDouble(1D) | ||
val res18: NDouble = NDouble@3ff00000 | ||
|
||
scala> res18.toString | ||
val res19: String = NDouble@3ff00000 | ||
|
||
scala> 1.0D | ||
val res20: Double = 1.0 | ||
|
||
scala> class NChar(val x: Char) extends AnyVal | ||
// defined class NChar | ||
|
||
scala> NChar('a') | ||
val res21: NChar = NChar@61 | ||
|
||
scala> res21.toString | ||
val res22: String = NChar@61 | ||
|
||
scala> 'a' | ||
val res23: Char = a | ||
|
||
scala> class NString(val x: String) extends AnyVal | ||
// defined class NString | ||
|
||
scala> NString("test") | ||
val res24: NString = NString@364492 | ||
|
||
scala> res24.toString | ||
val res25: String = NString@364492 | ||
|
||
scala> "test" | ||
val res26: String = test |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.