// Copyright Contributors to the Open Shading Language project.
// SPDX-License-Identifier: BSD-3-Clause
// https://github.com/AcademySoftwareFoundation/OpenShadingLanguage


void funca(int a) {}
void funca(int a, int b) {}

int funcb() { return 1; }
float funcb() { return 2; }
color funcb() { return 3; }

struct A { float a; };
struct B { float b; };

A ambig_struct_return() { A a; return a; }
B ambig_struct_return() { B b; return b; }

shader test()
{
    funca();        // fail too few arguments
    funca(1, 2, 3); // fail too many arguments
    funca(1.0, 2);  // fail float -> int
    funca(1, 2.0);  // fail float -> int
    funcb();        // fail unresolvable ambiguity

    (int) funcb();  // ok

    ambig_struct_return();
}

