mirror of
https://github.com/dart-lang/sdk
synced 2024-11-02 12:24:24 +00:00
715d59779e
The current specification seems to allow (or even mandate) that a redirecting constructor (factory or generative) must be considered as a syntactic shorthand for an invocation of the redirection target, with no checks applied statically or dynamically according to the declarations in the redirected constructor. So the following would be OK: class A { A(num n) { print(n); } A.foo(int i): this(i); } main() => new A.foo(3.0); This CL changes dartLangSpec.tex to mandate all the checks (static and dynamic) for the declaration of the redirecting constructor as well as each one of the redirection targets. Note that the analyzer already rejects the above program, which lessens the disruption and the implementation burden, but compilers would presumably need to have the dynamic checks implemented. Underlying issues: https://github.com/dart-lang/sdk/issues/31590, https://github.com/dart-lang/sdk/issues/32049, https://github.com/dart-lang/sdk/issues/32511. Change-Id: Icc15da6b817e4e678cdfc8829a1e06458756eb4b Reviewed-on: https://dart-review.googlesource.com/28140 Reviewed-by: Leaf Petersen <leafp@google.com> Reviewed-by: Lasse R.H. Nielsen <lrn@google.com> |
||
---|---|---|
.. | ||
language | ||
newsletter |