Skip to content

where clauses not recognized in method signatures #336

@apblack

Description

@apblack

Look at this error message:

basicTypesBundle.grace[14:24]: Syntax error: a type argument list containing a '⟦' must have a matching '⟧'. 
  13:         matches (value:Object) → Boolean
  14:         & (other:Type⟦U where U <: Type⟧) → Type⟦T&U⟧    // answers the join (Self & other)
-----------------------------^

The arrow points to the space before the where. I believe that the where is fine (modulo declaring U somewhere; see language design issue #156). However, miningrace's parser is not expecting a where in this type parameter.

The problem arises because minigrace is confused about the difference between type arguments and type parameters. Come to think if it: I'm confused too. In the above example, the Type... after parameter other: is an applied occurence of a type expression — in other words, a type argument — so everything in it should already be defined. So: can type parameters be qualified by where clauses in method signatures? Should the where go somewhere else?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions