func go.pact.im/x/plumb/internal/diag.Errorf
71 uses
go.pact.im/x/plumb/internal/diag (current package)
diag.go#L80: func Errorf(pos token.Position, kind ErrorKind, detail string, args ...any) *Error {
go.pact.im/x/plumb/internal/discover
discover.go#L54: return nil, diag.Errorf(diag.PosIn(fset, c.Pos()), diag.ErrInvalidSetName,
discover.go#L58: return nil, diag.Errorf(diag.PosIn(fset, c.Pos()), diag.ErrInvalidSetName,
discover.go#L65: return nil, diag.Errorf(diag.PosIn(fset, c.Pos()), diag.ErrDuplicateDirective,
discover.go#L190: return diag.Errorf(diag.PosIn(pkg.Fset, c.Pos()), diag.ErrMisplacedDirective,
discover.go#L268: return nil, diag.Errorf(diag.PosIn(pkg.Fset, fd.Name.Pos()), diag.ErrInvalidType, "declaration of %s did not type-check; cannot wire it", fd.Name.Name)
discover.go#L281: return nil, diag.Errorf(pos, diag.ErrBlankProvider, "give the function a name; a blank identifier declares nothing to wire")
discover.go#L287: return nil, diag.Errorf(pos, diag.ErrInitProvider, "init cannot be referenced, so it cannot provide; rename the function")
discover.go#L308: return nil, diag.Errorf(pos, diag.ErrBlankProvider, "give the method a name; a blank identifier declares nothing to wire")
discover.go#L314: return nil, diag.Errorf(pos, diag.ErrInvalidType, "method %s has an unresolvable receiver type", fn.Name())
discover.go#L317: return nil, diag.Errorf(pos, diag.ErrInvalidType, "receiver type parameter count for method %s.%s is %d; expected %d", named.Obj().Name(), fn.Name(), got, want)
discover.go#L322: return nil, diag.Errorf(pos, diag.ErrInvalidType, "method %s cannot be declared on interface type %s", fn.Name(), named.Obj().Name())
discover.go#L327: return nil, diag.Errorf(pos, diag.ErrInvalidType, "declaration of method %s.%s did not type-check; cannot wire it", named.Obj().Name(), fn.Name())
discover.go#L377: return nil, diag.Errorf(diag.PosIn(pkg.Fset, c.Pos()), diag.ErrMisplacedDirective,
discover.go#L429: return nil, diag.Errorf(diag.PosIn(pkg.Fset, s.Names[0].Pos()), diag.ErrBlankProvider, "give the variable a name; a blank identifier declares nothing to wire")
discover.go#L443: return nil, diag.Errorf(diag.PosIn(pkg.Fset, ident.Pos()), diag.ErrInvalidType, "declaration of %s did not type-check; cannot wire it", ident.Name)
discover.go#L463: return nil, diag.Errorf(pos, diag.ErrInvalidConversion, "must declare an explicit target type")
discover.go#L472: return nil, diag.Errorf(pos, diag.ErrInvalidConversion, "needs a source like (*T)(nil); write the source type explicitly")
discover.go#L485: return nil, diag.Errorf(pos, diag.ErrInvalidType, "conversion source did not type-check; cannot wire it")
discover.go#L488: return nil, diag.Errorf(pos, diag.ErrInvalidConversion, "bare nil source; write (*Concrete)(nil) or name the source type")
discover.go#L499: return nil, diag.Errorf(pos, diag.ErrInvalidConversion, "the source must name a type, e.g. (*T)(nil); a constant takes the target's own type")
discover.go#L501: return nil, diag.Errorf(pos, diag.ErrInvalidConversion, "identity conversion: source and target are both %s", gotypes.TypeName(targetType))
discover.go#L509: return nil, diag.Errorf(pos, diag.ErrInvalidConversion, "cannot convert %s to %s", gotypes.TypeName(srcType), gotypes.TypeName(targetType))
discover.go#L528: return nil, diag.Errorf(diag.PosIn(pkg.Fset, s.Names[0].Pos()), diag.ErrBlankProvider, "give the constant a name; a blank identifier declares nothing to wire")
discover.go#L538: return nil, diag.Errorf(diag.PosIn(pkg.Fset, ident.Pos()), diag.ErrInvalidType, "declaration of %s did not type-check; cannot wire it", ident.Name)
discover.go#L542: return nil, diag.Errorf(pos, diag.ErrUntypedConstant, "constant %s must have an explicit type", obj.Name())
discover.go#L570: return nil, diag.Errorf(diag.PosIn(pkg.Fset, s.Name.Pos()), diag.ErrBlankProvider, "give the type a name; a blank identifier declares nothing to wire")
discover.go#L575: return nil, diag.Errorf(diag.PosIn(pkg.Fset, s.Name.Pos()), diag.ErrInvalidType, "declaration of %s did not type-check; cannot wire it", s.Name.Name)
discover.go#L608: return nil, diag.Errorf(diag.PosIn(pkg.Fset, s.Name.Pos()), diag.ErrBlankProvider, "give the type a name; its members cannot be reached through a blank identifier")
discover.go#L615: return nil, diag.Errorf(diag.PosIn(pkg.Fset, c.Pos()), diag.ErrInvalidType, "declaration of %s did not type-check; cannot wire its members", s.Name.Name)
discover.go#L653: return nil, diag.Errorf(pos, diag.ErrStructProvider, "%s is %s; struct-type providers are only supported on struct types",
discover.go#L691: return nil, diag.Errorf(pos, diag.ErrEmbeddedField, "give the field a name to use it")
discover.go#L696: return nil, diag.Errorf(pos, diag.ErrBlankProvider, "give the field a name; a blank identifier declares nothing to wire")
discover.go#L710: return nil, diag.Errorf(diag.PosIn(pkg.Fset, ident.Pos()), diag.ErrInvalidType, "declaration of %s did not type-check; cannot wire it", ident.Name)
discover.go#L745: return nil, diag.Errorf(pos, diag.ErrEmbeddedInterface, "put the directive on a method instead")
discover.go#L749: return nil, diag.Errorf(pos, diag.ErrConstraintInterfaceMethod, "%s: a constraint type cannot be the type of a value, so it cannot be a receiver", gotypes.TypeNameOf(owner).Name())
discover.go#L756: return nil, diag.Errorf(diag.PosIn(pkg.Fset, ident.Pos()), diag.ErrInvalidType, "declaration of %s did not type-check; cannot wire it", ident.Name)
go.pact.im/x/plumb/internal/gen
gen.go#L62: return nil, diag.Errorf(token.Position{}, diag.ErrNoDirectives, "nothing to generate")
gen.go#L124: return nil, diag.Errorf(diag.PosIn(pkg.Fset, obj.Pos()), diag.ErrDestShadowsPredeclared, "destination package %q declares %s (%s), shadowing the predeclared identifier; rename the declaration", opts.ImportPath, name, base)
go.pact.im/x/plumb/internal/solve
checks.go#L21: return diag.Errorf(p.Pos, diag.ErrInvalidType, "provider %s is instantiated at %s", p.Name, gotypes.TypeName(ta))
checks.go#L25: return diag.Errorf(p.Pos, diag.ErrInvalidType, "conversion %s", p.Name)
checks.go#L34: return diag.Errorf(p.Pos, diag.ErrUnexportedProvider, "provider %s referenced from package %q; export it or generate into its own package", p.Name, s.destPath)
checks.go#L41: return diag.Errorf(p.Pos, diag.ErrUnreachableType, "type argument %s of provider %s, from package %q (%s is unexported)", gotypes.TypeName(ta), p.Name, obj.Pkg().Path(), obj.Name())
checks.go#L47: return diag.Errorf(p.Pos, diag.ErrUnreachableType, "conversion target type %s from package %q (%s is unexported)", gotypes.TypeName(p.ConvertTo), obj.Pkg().Path(), obj.Name())
checks.go#L55: return diag.Errorf(pl.pos, diag.ErrInvalidType, "injector input type %s", gotypes.TypeName(t))
checks.go#L58: return diag.Errorf(pl.pos, diag.ErrUnreachableType, "injector input type %s, from package %q (%s is unexported)", gotypes.TypeName(t), obj.Pkg().Path(), obj.Name())
checks.go#L63: return diag.Errorf(pl.pos, diag.ErrInvalidType, "injector output type %s", gotypes.TypeName(t))
checks.go#L66: return diag.Errorf(pl.pos, diag.ErrUnreachableType, "injector output type %s, from package %q (%s is unexported)", gotypes.TypeName(t), obj.Pkg().Path(), obj.Name())
checks.go#L80: return diag.Errorf(pl.pos, diag.ErrInvalidType, "lifted type parameter %s has a constraint that does not type-check", tp.Obj().Name())
checks.go#L83: return diag.Errorf(pl.pos, diag.ErrUnreachableType, "lifted type parameter %s has a constraint from package %q (%s is unexported)", tp.Obj().Name(), obj.Pkg().Path(), obj.Name())
checks.go#L131: return diag.Errorf(pl.pos, diag.ErrReservedName, "set %q would generate a func init; init must take no parameters and return nothing", s.name)
checks.go#L134: return diag.Errorf(pl.pos, diag.ErrReservedName, "set %q would generate a func main in package main", s.name)
checks.go#L145: return diag.Errorf(pl.pos, diag.ErrShadowsPredeclared, "set %q would generate a top-level func %q shadowing the builtin for the whole destination package; rename the set", s.name, s.name)
checks.go#L164: return diag.Errorf(pl.pos, diag.ErrSetNameCollision, "set %q in package %q (%s); rename the set", s.name, s.destPath, base)
checks.go#L173: return diag.Errorf(pl.pos, diag.ErrSetNameCollision, "set %q matches an import qualifier in package %q (%s); rename the set", s.name, s.destPath, base)
instance.go#L265: return diag.Errorf(p.Pos, diag.ErrMultipleErrors, "provider %s returns more than one error result; at most one is supported", p.Name)
order.go#L153: return diag.Errorf(cycle[0].pos, diag.ErrDependencyCycle, "set %q: %s", s.name, strings.Join(parts, " → "))
solve.go#L246: return nil, diag.Errorf(provs[0].Pos, diag.ErrNonTerminating, "set %q: pinning revision did not converge after %d restarts", name, maxRestarts)
solve.go#L298: return diag.Errorf(p.Pos, diag.ErrBareTypeParamResult, "provider %s would match every demand", p.Name)
solve.go#L301: return diag.Errorf(p.Pos, diag.ErrBareTypeParamResult, "provider %s produces *T for a bare type parameter, matching every pointer demand and, through the value/pointer bridge, every value demand", p.Name)
solve.go#L539: return false, diag.Errorf(p.Pos, diag.ErrNonTerminating, "set %q: produced type %s exceeds depth %d", s.name, gotypes.TypeName(vo), maxTypeDepth)
solve.go#L545: return false, diag.Errorf(p.Pos, diag.ErrNonTerminating, "set %q exceeded %d instantiations; a provider appears to manufacture unboundedly larger types", s.name, maxInstantiations)
solve.go#L599: return diag.Errorf(in.pos, diag.ErrAmbiguousProducer, "provider %s produces multiple values of type %s", in.Prov.Name, gotypes.TypeName(vo))
solve.go#L607: return diag.Errorf(in.pos, diag.ErrAmbiguousProducer, "provider %s produces %s at more than one instantiation; this result does not depend on the type parameter: give it a type-parameter-dependent type or split the provider", in.Prov.Name, gotypes.TypeName(vo))
solve.go#L631: return diag.Errorf(p.Pos, diag.ErrUnusedTemplate, "provider %s in set %q is never instantiated: %w", p.Name, s.name, reason)
solve.go#L641: return diag.Errorf(p.Pos, diag.ErrUnusedTemplate, "provider %s in set %q: %s is already %s, so no demand is left for it: remove the template or the other provider", p.Name, s.name, gotypes.TypeName(d), by)
solve.go#L643: return diag.Errorf(p.Pos, diag.ErrUnusedTemplate, "provider %s in set %q: no consumer pins its result type: add a consumer or remove it", p.Name, s.name)
solve.go#L732: return diag.Errorf(in.pos, diag.ErrInvalidType, "provider %s references %s", in.Prov.Name, gotypes.TypeName(t))
solve.go#L746: return diag.Errorf(cs[0].prov.Pos, diag.ErrAmbiguousTemplates, "templates %s and %s both match one demand",
solve.go#L800: return diag.Errorf(ps[0].Pos, diag.ErrAmbiguousTemplates, "templates %s and %s both produce %s",
solve.go#L809: return diag.Errorf(first.pos, diag.ErrAmbiguousProducer, "type %s is produced by both %s (%s) and %s (%s); plumb never picks a winner",