jamesjuett / lobster

Interactive Program Visualization Tools
8 stars 3 forks source link

Qualified Type Names #335

Open jamesjuett opened 2 years ago

jamesjuett commented 2 years ago

This will require some changes to the grammar/parser as well as compiler.

class Test {
  class Nested {
    Nested *n_a;
    Test::Nested *n_b;
    ::Test::Nested *n_c;
    Test *t_d;
    ::Test *t_e;

    Nested err_n; // error incomplete type
    Test err_t; // error incomplete type
  };

  Nested *n_a_out;
  Test::Nested *n_b_out;
  ::Test::Nested *n_c_out;
  Test *t_d_out;
  ::Test *t_e_out;

  Test err_t_out; // error incomplete type
  Nested ok_n_out; // fine, Nested is complete here
};

int main() {
  Test t1;
  ::Test t2;
  Test::Nested n1;
  ::Test::Nested n2;
}

Test t1_global;
::Test t2_global;
Test::Nested n1_global;
::Test::Nested n2_global;