Skip to content

improve generic type inference #657

Closed

Description

@Frotty

Currently in the stdlib we have:

function foldl<Q>(Q startValue, FoldClosure<T, Q> predicate) returns Q

function toString() returns string
	let fold = foldl<string>("[", (i, q) -> q + (i castTo int).toString() + ",")
	return fold.substring(0, fold.length()-1) + "]"

I would like to not have to use the generic param <string> because the type could be inferred by the first parameter "[" which is of type Q.

Activity

  1. added a commit that references this issue on Jun 13, 2018
  2. peq commented on Jun 13, 2018

    @peq
    Collaborator

    Fixed with #673

  3. added a commit that references this issue on Jun 13, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions