DescriptionAdds limited support for private classes.
Subtype/superclass quantification can include private classes, even
though this may not be needed (or even intended) by the programmer who
wrote the capabilities, or the programmer who use them via an import.
This CL ensures that we do not any more generate type expressions that
fail to compile because they attempt to access a private class in a
different library.
We keep the private classes in place because they are needed during
traversals of superclass chains (they should not fail when superclass
quantification is enabled), and they do have `declarations` and other
features as expected for any class mirror.
It is quite common that a given "official" class `C` is used by
clients (in type annotations etc.), but they will actually be using
instances of "secret" subclasses, possibly private, often because
they have obtained those objects using factory constructors (a good
example is `List`). This means that it is very useful to be able to
obtain an instance mirror for such an instance, and also to do
`.type` and get a class mirror for it.
That feature can only be supported if we can recognize that a given
object is an instance of a specific private class, and we do not
have a maintainable way to do that. So we leave out that bit for now.
Fixes the code generation problem reported in issue #43.
R=sigurdm@google.com
Committed: https://github.com/dart-lang/reflectable/commit/2d9b6f5584b921183faec6d2d5b8d09265175bd0
Patch Set 1 #
Total comments: 14
Patch Set 2 : Improved comments, formatting. #Patch Set 3 : Review response; disable `reflect` on private classes. #Patch Set 4 : Additional review response. #Patch Set 5 : Improved on treatment of uri #
Messages
Total messages: 7 (1 generated)
|