the typefunction branch is now only fails expected test

Stefan Koch uplink.coder at googlemail.com
Mon Jan 4 23:48:32 UTC 2021


Good evening,

I am proud to say that after a couple minutes of bugfixing.

the latest typefunction development branch 'talias_master' does 
no longer fail any tests which don't have to do with the semantic 
changes

the tests which it fails are:

---
/*
TEST_OUTPUT:
---
fail_compilation/fail239.d(8): Error: type `F` is not an 
expression
---
*/
class F { int x; }
alias typeof(F).x b;
---

/*
TEST_OUTPUT:
---
fail_compilation/fail240.d(9): Error: type `F` is not an 
expression
---
*/

class F { int x; }
alias typeof(typeof(F).x) b;
---

and

---
/*
TEST_OUTPUT:
---
fail_compilation/fail248.d(9): Error: type `int` is not an 
expression
---
*/

alias int foo;
typeof(foo) a; // ok
---

Because a type is now indeed an expression.
And the type of 'int' is '__type__'

It should also be noted that, with a minor change to phobos in 
'CommonType' it's unittests pass.
The reason why CommonType has to be changed is because it is 
written to assume that typeof(some_type) yields an error.
Which is now no longer the case.

apart from that; Everything that used to work works!

When using type functions with std.range  however things are 
still failing since std.range is written in an obtuse style and 
very brittle.

Cheers,

Stefan


More information about the Digitalmars-d mailing list