(t *testing.T)
| 623 | } |
| 624 | |
| 625 | func TestSingletonOverloadLateBindingCollision(t *testing.T) { |
| 626 | fn, err := NewFunction("id", |
| 627 | Overload("id_any", []*types.Type{types.AnyType}, types.AnyType, |
| 628 | LateFunctionBinding(), |
| 629 | ), |
| 630 | SingletonUnaryBinding(func(arg ref.Val) ref.Val { |
| 631 | return arg |
| 632 | }), |
| 633 | ) |
| 634 | if err != nil { |
| 635 | t.Fatalf("NewFunction() failed: %v", err) |
| 636 | } |
| 637 | _, err = fn.Bindings() |
| 638 | if err == nil || !strings.Contains(err.Error(), "incompatible with late bindings") { |
| 639 | t.Errorf("NewFunction() got %v, wanted incompatible with late bindings", err) |
| 640 | } |
| 641 | } |
| 642 | |
| 643 | func TestSingletonUnaryBindingRedefinition(t *testing.T) { |
| 644 | _, err := NewFunction("id", |
nothing calls this directly
no test coverage detected