問題タブ [extension-function]
For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.
android - kotlin拡張機能のベースオブジェクトにコンテキストを付与
この質問は、Android 開発で使用される Kotlin の拡張機能に固有のものです。
そのため、Kotlin は、特定の拡張動作をクラスに追加して、ベース クラスの動作を拡張する機能を提供します。
例: (Espresso でのテストでの viewAssertion について、現在の Android プロジェクトから取得)
私のユースケースでは、次のように使用できます。
この拡張機能が、Int
Android のビュー ID だけでなく、すべてのオブジェクトに拡張された動作を与えることを除いて、すべて良いことです。これはまったく良くありません。
問題は、これにコンテキストを与える方法があるかどうかです.AndroidInt
のように、上記のようなケースのAndroidサポートアノテーションに @IdRes がありますか?