Comment

Comment by o11c

Any statically-typed language has this. In pseudo-Java:

  class Parent {};
  class Child extends Parent {};
  class Wrapper
  {
      Parent foo;
  }

  w = new Wrapper();
  w.foo = new Child();

  evaluate w.foo;
  // static type: Parent
  // dynamic type: Child
parent o11c 11 months ago

No comments yet

Be the first to share your thoughts.

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton