Created
September 21, 2018 03:39
-
-
Save seldridge/6391cfb467f1c8ba713b843ab500172e to your computer and use it in GitHub Desktop.
This file contains 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
object X { | |
def f(x: Int): Int = 1 | |
} | |
object Y { | |
def f(x: Int): String = "a" | |
} | |
import X._ | |
import Y._ | |
val x: Int = f(1) | |
val y: String = f(1) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Ok, I understand this. The trade off is between doing
viewSomeKindOfOptions
vs
SomeKindOfOptionsObject.getView()
The verbiage is nearly equal while the upper one requires more complicated imports which may or may not trip up some programmers.
I don't know that there is a compelling way of settling this.
I'd also throw out that the view method could be more explicitly named as in getFirrtlOptions, it's not as though we are passing things around in way that some other method might take the view type as a parameter (I think).
My two cents