[BUG] error: "too little data in type constructor", and then fatal error

Bug report and files:
https://github.com/mc-imperial/shader-compiler-bugs/issues/14

Fragment shader:

#version 440

float foo(out vec3 p)
{
    for(int c = 0; c < 6; ++ c) {
        p = abs(p) +
            vec3(1.0,
                 (false ? 1.0 : (false ? distance(1.0, 1.0) : 1.0)) + (true ? 0.1 : length(vec3(1.0))),
                 (true ? 1.0 : 1.0 - step(1.0, 1.0)) + 0.3
            );
    }
    return 1.0;
}
void main(void)
{
   vec3 v;
   foo(v);
}

Link error log:

Fragment info
-------------
0(17) : error C1067: too little data in type constructor
0(17) : error C1067: too little data in type constructor
(0) : fatal error C9999: Can't convert to expr: 1, @TMP3 + 0.1f

Note that the shader is accepted by glslangValidator and works with a recent Intel driver.

  1. Operating system version.

Windows 10

  1. Graphics hardware.

GeForce GTX 770. Driver: 373.06

  1. Reproducer project.
    We have provided the fragment shader at the above link.

  2. Description of single steps to reproduce the problem.
    Compile and link the fragment shader.

  3. Description of the expected result.
    No link error.

Thanks for the report. We have filed an internal bug to track this issue.