Skip to content
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

Behind names for types make no sense #260

Open
dahlia opened this issue Apr 19, 2018 · 1 comment
Open

Behind names for types make no sense #260

dahlia opened this issue Apr 19, 2018 · 1 comment
Assignees
Labels
cat:lang Category: Language design cmp:compiler Component: Compiler backend (e.g., annotation processors, code generators) cmp:frontend Component: Compiler frontend (e.g., CLI, parser, AST) typ:bug Type: Bug/defect

Comments

@dahlia
Copy link
Member

dahlia commented Apr 19, 2018

Unlike fields, tags, methods, and method parameters, type names don't play any role in transportation. Types have names, and "_type" hint field in serialization format, but they're only for human programmers. These "_type" hints are ignored when a program interprets a serialized value.

So the parser should disallow to add a behind name to type declarations.

Currently it even raises an error if two types have the same behind name (but two different facial names) for no reason:

record foo/dup (text x);
record bar/dup (text y);
examples/type-behind-name.nrm:4:1:
the behind type name `dup` is duplicated


^
@dahlia dahlia added typ:bug Type: Bug/defect cmp:compiler Component: Compiler backend (e.g., annotation processors, code generators) cat:lang Category: Language design cmp:frontend Component: Compiler frontend (e.g., CLI, parser, AST) labels Apr 19, 2018
@dahlia dahlia self-assigned this Apr 19, 2018
@dahlia
Copy link
Member Author

dahlia commented Apr 19, 2018

It might be better to remove "_type" field too?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cat:lang Category: Language design cmp:compiler Component: Compiler backend (e.g., annotation processors, code generators) cmp:frontend Component: Compiler frontend (e.g., CLI, parser, AST) typ:bug Type: Bug/defect
Projects
None yet
Development

No branches or pull requests

1 participant