LuaLS / LuaLS/lua-language-server
Feature request: Opaque/nominal types
Nessuno ha ancora preso questa issue.
- Lingua principale
- Lua
- Stelle
- 4.4k
- Fork
- 442
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Descrizione
The problem
It often happens that library functions return objects the type of which is an implementation detail. For example an identifier may be an integer but could suddenly be changed to a string, and the client code shouldn't fail because of that.
Safely typing such an identifier in LLS is currently impossible:
- typing it as
integerdepends on a potentially unstable implementation detail - typing it as
anyis unsound
In other words, structural typing fails when the structure isn't stable or known.
Feature request
An annotations that declares a completely opaque/nominal type. It could be --@opaque typename, --@alias typename without any arguments, or anything else. Values belonging of such a type cannot be inspected in any way and can only be passed around. Values of different opaque types cannot be mixed up (so this is stronger than unknown in typescript)
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Direzione di ricerca
Non vengono nominati file, test o punti di ingresso. Inizia individuando il codice di annotazione e controllo dei tipi per gli alias e i tipi sconosciuti, quindi traccia il modo in cui i valori vengono ispezionati o mescolati. Il lavoro è completato quando il language server supporta tipi opachi distinti che possono solo essere passati, con copertura per il comportamento richiesto.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- lua
- Ambito
- compilers
- Tipo di issue
- Funzionalità
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Stato di attività
- Ferma
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 35/100