Skip to content
GitLab
Projects Groups Topics Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Register
  • Sign in
  • pike pike
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributor statistics
    • Graph
    • Compare revisions
  • Issues 107
    • Issues 107
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 0
    • Merge requests 0
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Artifacts
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Container Registry
    • Model experiments
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • pikelang
  • pikepike
  • Issues
  • #6064

Type checker: Improve diagnostics for bad arguments to varargs.

Imported from http://bugzilla.roxen.com/bugzilla/show_bug.cgi?id=6064

Reported by @grubba

From the Pike mailinglist (12575/LysLysKOM 19260004):

Pike v7.9 release 5 running Hilfe v3.5 (Incremental Pike Frontend)
> array a = ({});
> mapping m = ([]);
> a+m;
Compiler Error: 1: Too few arguments to `+ (got 2).
Compiler Error: 1: Expected: object | mixed.
Compiler Error: 1: Function type:
Compiler Error: 1: Got     : scope(0,function((0=multiset), (1=multiset) ... : 0 | 1) | function((0=mapping), (1=mapping) ... : 0 | 1) | function((0=array), (1=array) ... : 0 | 1) | function(int, int ... : int) | !function(!string ... : mixed) & function(string | int | float, string | int | float ... : string) | !function(!float ... : mixed) & function(int | float, int | float ... : float) | !function(!(object | mixed) ... : mixed) & function(mixed ... : mixed)).

The type checker probably also ought to check if there's any combination of argument types that satisfy the function type, ie in this case suggest that argument 2 ought to be an array.

Assignee
Assign to
Time tracking