-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
A strawman for aggregate literals #21993
base: main
Are you sure you want to change the base?
Conversation
A test case that shows that we can have an "inline type class" that allows to use a typeclass-based scheme for sequence literals where instances can be created with macros.
Also: Move test to run
We now don't try to instantiate selected type variables. Instead, we use a default as fallback if the expected type is underspecified according to the definition in Implicits. This is simpler and more expressive.
a728906
to
6e904fb
Compare
From the doc I understand that implicit conversions are not applicable. Is weak conformance applicable? |
The successor of weak conformance (int literal widening) is usually applicable. That follows from the fact that SeqLiterals expand to varargs and varargs do perform that widening. |
@@ -278,6 +278,7 @@ SimpleExpr ::= SimpleRef | |||
| ‘new’ ConstrApp {‘with’ ConstrApp} [TemplateBody] New(constr | templ) | |||
| ‘new’ TemplateBody | |||
| ‘(’ ExprsInParens ‘)’ Parens(exprs) | |||
| ‘[’ ExprInBrackets ‘)’ SeqLiteral(exprs, TypeTree()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| ‘[’ ExprInBrackets ‘)’ SeqLiteral(exprs, TypeTree()) | |
| ‘[’ ExprInBrackets ‘]’ SeqLiteral(exprs, TypeTree()) |
just noticed while having a look
A test case that shows that we can have an "inline type class" that allows to use a typeclass-based scheme for sequence literals where instances can be created with macros.