Skip to content

Conversation

@soutaro
Copy link
Member

@soutaro soutaro commented Oct 16, 2019

This proposes to support specifying variance of class/module/interface generic members.

class ReadOnlyArray[out A]
  def []: (Integer) -> A
end

We use out for co-variant, in for contra-variant, (empty) for in-variant.

The parser also implements unchecked attribute so that we can make array co-variant.

class Array[unchecked out Elem]
  ...
end

@soutaro soutaro merged commit badd2d5 into master Oct 20, 2019
@soutaro soutaro deleted the variance branch October 20, 2019 07:57
@soutaro soutaro mentioned this pull request Oct 24, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants