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
provide a way to find parameter types of ClassModel #750
Comments
I screwed up. Again. I had to remove |
I don't get it. Didn't we say that classes with initialisers emulate having a single default constructor? That seems wrong: shared sealed interface ClassWithInitializerDeclaration
satisfies ClassDeclaration {
shared actual default [] constructorDeclarations() => [];
shared actual default Null defaultConstructorDeclaration => null; It should have a single constructor, no? |
Now at the level of the model (not declaration) it makes a lot more sense to abstract away, as much as possible, the difference. That's partly what |
Well, I don't see why we can't change the definition of class with initialiser to say it's equivalent to class with single default constructor, unless they are conceptually different but I don't see how. As for it being hard to implement, is it hard or impossible? Because it still sounds like it would be the most convenient way to do it. Same for the model, ATM sure we have Now, about annotations, that's a good question. I suppose the answer depends on how annotations apply to constructors vs types, which is still an open question ATM. |
They're not actually used since it's very difficult to usefully abstract callable constructors and value constructors since they're very different and existing abstractions such as Declaration are sufficient. Part of #750
* Add ClassDeclaration.defaultConstructor, refined to be non-optional on ClassWithInitialiserDeclaration. * Make parameterDeclarations optional on ClassDeclaration, refined to be non-optional on ClassWithInitialiserDeclaration. * Fix doc on getParameterDeclaration() to clarify it will always return null on classes with neither parameter list nor default constructor. * Add a test for these things * Fix a couple of broken tests Part of #750
I've pushed a |
I'm not sure what sort of feedback you're looking for, but sticking to the basics:
|
Thanks @jvasileff, that's perfect. @chochos, would you be able to take a look at the |
sure, just le me fix a compiler bug I found last night |
ready to merge... |
They're not actually used since it's very difficult to usefully abstract callable constructors and value constructors since they're very different and existing abstractions such as Declaration are sufficient. Part of #750
* Add ClassDeclaration.defaultConstructor, refined to be non-optional on ClassWithInitialiserDeclaration. * Make parameterDeclarations optional on ClassDeclaration, refined to be non-optional on ClassWithInitialiserDeclaration. * Fix doc on getParameterDeclaration() to clarify it will always return null on classes with neither parameter list nor default constructor. * Add a test for these things * Fix a couple of broken tests Part of #750
I've rebased and merged this branch. |
There doesn't seem to be a replacement for
ClassModel.parameterTypes
.I tried without success to obtain either a
CallableConstructorDeclaration
or aFunctionModel
:The text was updated successfully, but these errors were encountered: