code: func flattenArgs(args callArguments, params Parameters) []*cachedThunk {
  	if len(args.named) == 0 {
  		return args.positional
  	}
  	if len(params.optional) != 0 {
  		panic("Can't normalize arguments if optional parameters are present")
  	}
  	needed := make(map[ast.Identifier]int)
  
  	for i := len(args.positional); i < len(params.required); i++ {
  		needed[params.required[i]] = i
  	}
  
  	flatArgs := make([]*cachedThunk, len(params.required))
  	copy(flatArgs, args.positional)
  	for _, arg := range args.named {
  		flatArgs[needed[arg.name]] = arg.pv
  	}
  	return flatArgs
  }
docs: // flattenArgs transforms all arguments to a simple array of positional arguments.
  // It's needed, because it's possible to use named arguments for required parameters.
  // For example both `toString("x")` and `toString(a="x")` are allowed.
  // It assumes that we have already checked for duplicates.