Feature Request: Interfaces should suppport ivars
Maintainer antworten meist innerhalb von 1 Tag
Dieses Issue hat noch niemand übernommen.
Bewertung
- Schwierigkeit
- 5/5
- Geschätzter Aufwand
- Über eine Woche
- Anfängerfreundlichkeit
- 35/100
Rechercherichtung
Start with the interface and mixin examples in the issue, then read the referenced PR #3256 for context. Define what interface instance variables should mean for these examples and how the behavior can be validated; done means the desired semantics are clear and the proposed feature is specified.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
This is a request for an addition to the concept of Interfaces; while I get that the inspiration for RBS interfaces are Java Interfaces, where the definition of methods, and not assomuch state, is the way to define them. However, the concept is quite limiting considering what Interfaces are used for RBS/Ruby. Interfaces are the defacto way to define duck-typing. In ruby, this is not constrained to methods, specially when one considers mixins. A random example:
module IoOps
def read_and_eval
payload = @io.read
# ...
end
end
class TCPWrapper
@io: TCPSocket
end
class SSLWrapper
@io: OpenSSL::SSL::SSLSocket
end
# given that, I'd like to define a mixin for each
interface _IOWrapper
@io: _ToIO # this interface should cover both tcp and ssl sockets
end
module IoOps : _IOWrapper # https://github.com/ruby/rbs/pull/3256
end
I think this type of mixins are common enough; Think about extensions which apply to different db adapters.
- Vorherrschende Sprache
- Ruby
- Sterne
- 2.2k
- Forks
- 260
- Ø Merge
- 22 Std. 3 Min.
- Gemergte PRs (30 T.)
- 54
Entwicklungsumgebung
- Kein Dockerfile und keine Docker-Compose-Datei
- Keine Pull-Request-Vorlage
- Beitragsleitfaden lesen
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus ruby/rbs
-
InlineParser: `@rbs @ivar` annotation is reported as unused unless it is the first thing in the class bodyEvtl. vergeben @ksss hat das vor 39 Tagen übernommen. Offen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 82/100
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 85/100
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 78/100
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 5/5 Über eine Woche Anfängerfreundlichkeit 15/100
Maintainer antworten meist innerhalb von 1 Tag
Ähnliche Issues
-
test_rescues_connection_reset_on_issue_comments_lookup fails on master and blocks every pull requestOffen
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 91/100
zerocracy/judges-action#3142 ·
Maintainer antworten meist innerhalb von 2 Tagen
-
Malformed encoded_filters causes a 500, and keeps failing with session persistenceEvtl. vergeben @officialasishkumar hat das heute übernommen. Offen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 80/100
avo-hq/avo#4986 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 62/100
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 88/100
-
Visual COBOL: missing 11.0 and 12.0, and 9.0 date differs from Rocket Software's lifecycle pageOffen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
endoflife-date/endoflife.date#11561 ·
Maintainer antworten meist innerhalb von 1 Tag