[dmd-internals] [D-Programming-Language/dmd] c2ba89: fix Issue 11614 - Error: this for _expand_field_0 ...

GitHub noreply at github.com
Sat Nov 30 12:25:12 PST 2013


  Branch: refs/heads/master
  Home:   https://github.com/D-Programming-Language/dmd
  Commit: c2ba89dc203c34740fbc21d8a116994046a7bbf4
      https://github.com/D-Programming-Language/dmd/commit/c2ba89dc203c34740fbc21d8a116994046a7bbf4
  Author: k-hara <k.hara.pg at gmail.com>
  Date:   2013-11-30 (Sat, 30 Nov 2013)

  Changed paths:
    M src/expression.c
    M test/runnable/testrightthis.d

  Log Message:
  -----------
  fix Issue 11614 - Error: this for _expand_field_0 needs to be type Tuple not type Foo

Even if a variable has no valid context, it would be either:

1. a part of compile time evaluated expression, which is used as unreal context.
    enum x = Type.fieldvar.sizeof;
    // It's legitimate expression so fieldvar is not evaluated
    // in runtime.

2. or an invalid field access without valid 'this', in runtime evaluated expression.
    int y = Type.fieldvar;
    // It's invalid expression so fieldvar access has no valid 'this'.

For the case #2, it will be an error by `checkRightThis` later. Therefore `getRightThis` should not make it an error.


  Commit: 4d994d640f32a50e3bfb84c5e99118c7a057cce4
      https://github.com/D-Programming-Language/dmd/commit/4d994d640f32a50e3bfb84c5e99118c7a057cce4
  Author: Martin Nowak <code at dawg.eu>
  Date:   2013-11-30 (Sat, 30 Nov 2013)

  Changed paths:
    M src/expression.c
    M test/runnable/testrightthis.d

  Log Message:
  -----------
  Merge pull request #2897 from 9rnsr/fix11614

[REG2.064] Issue 11614 - Error: this for _expand_field_0 needs to be type Tuple not type Foo


Compare: https://github.com/D-Programming-Language/dmd/compare/58562d274cd8...4d994d640f32


More information about the dmd-internals mailing list