dart-sdk/docs
Erik Ernst 715d59779e Added specification that redirecting constructors must be checked.
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>
2018-07-10 12:41:24 +00:00
..
language Added specification that redirecting constructors must be checked. 2018-07-10 12:41:24 +00:00
newsletter Newsletter 2017-11-24. 2017-11-24 16:27:00 +00:00