-
Notifications
You must be signed in to change notification settings - Fork 34
Add the types.T.Alias type
#653
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
89c61e7 to
aaf4a5a
Compare
|
Oi!, você pode por favor fazer o rebase dessa branch, pra cima do master? |
|
Olá! Sim. Assim que fizer, te aviso por aqui.
|
the error messages for messages for shadowing cases are subject to changes
aaf4a5a to
572e810
Compare
|
@hugomg feito o rebase |
|
Muito bom, agradeço pelos links no texto da PR, que ajudaram bastante. A única parte que achei um pouco esquisita foi a metatabela ACTUAL_NOMINAL_MT. Talvez não precise dessa mágica toda. Algumas dessas alternativas seria viável?
|
|
Reparei aqui que os testes não tinham rodado pois eu não tinha apertado o botão de "aprovar o workflow". |
Com certeza! Essa implementação realmente se tornou residual. De início achei que seria útil ter a possibilidade da destruturação desse par, mas na prática (no outro PR no qual trabalhei, que faz uso dos Sendo assim, acredito que seja boa ideia seguir pela alternativa (1) |
Não consegui rodar o CI, mas executei as verificações manualmente. O único detalhe é que foi necessário configurar o padrão da linguagem C para conseguir rodar os testes de forma bem-sucedida EXTRACFLAGS="-std=c11" ./run-testspois o compilador estava se queixando da redefinição do A propósito, o compilador C por padrão na minha máquina é o
Acho válido! |
|
Oi Igor, você pode fazer o merge? Eu também poderia, mas acho que é uma boa oportunidade pra testar se suas permissões de escrita estão funcionando. |
Description
With the purpose of being able to retrieve aliased types in the AST, we've introduced the new
Aliastype to thetypes.Tnamespace.Since we have the goal of being able to generate a type declaration file from a valid Pallene program, we are now forbidding exported symbols from shadowing each other. It is a measure for improving such files' consistency, so that their types don't mean different things depending on the reading order of the declarations.
Changes summary
Type shadowing prevention
spec/typechecker_spec.lua). [1] [2] [3]Typecheckerto use a newexport_type_symbolmethod and a unifiedcheck_exported_symbol_shadowingfunction for consistent error handling. [1] [2] [3]Type alias expansion and comparison
spec/types_spec.lua) [1] [2]IR conversion and code generation
src/pallene/to_ir.lua)src/pallene/coder.lua)