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

typed parameters #15

Merged
merged 17 commits into from
Nov 12, 2022
Merged

typed parameters #15

merged 17 commits into from
Nov 12, 2022

Conversation

earloc
Copy link
Owner

@earloc earloc commented Nov 12, 2022

Enables usage of type-annotations in parameter-tokens.

e.g. string in Hello {name:string}

initial support is done for the following types:

alias type example usage (alias) example usage (type)
i int {count:i} {count:int}
s string {name:s} {name:string}
dt DateTime {date:dt} {date:DateTime}
dto DateTimeOffset {date:dto} {date:DateTimeOffset}
d DateOnly {date:d} {date:DateOnly}
t TimeOnly {time:t} {time:TimeOnly}

one cann still omit the type-annotation, which will fall back to using object. However, if a type-annotation cannot be matched, the source-generator falls back to object, too, but emits a warning, additionaly.
See docs/reference/TR0004_UnrecognizedParameterType.md for further details.

Additionaly, this PR simplifies emitted diagnostics-codes.

closes #6

@earloc earloc merged commit f95ac2f into main Nov 12, 2022
@earloc earloc deleted the feature/typed-parameters branch November 12, 2022 22:13
@earloc earloc mentioned this pull request Nov 12, 2022
22 tasks
@earloc earloc restored the feature/typed-parameters branch November 29, 2022 13:00
@earloc earloc deleted the feature/typed-parameters branch November 29, 2022 13:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

honor type-annotations in parameter-declarations
1 participant