Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
暗黙を使用して、コンパニオン オブジェクト自体を変更せずにフィールドをコンパニオン オブジェクトに「追加」したいと考えています。次の例では、オブジェクト A からプロパティ「名前」にアクセスできるようにしたいと考えています。これは可能ですか?
implicit def a2b(???): ??? = B object A class A object B { val name = "Bob" }