Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Well-formedness check failure when operating on an Array type alias #1529

Closed
mario-bucev opened this issue May 17, 2024 · 0 comments · Fixed by #1531
Closed

Well-formedness check failure when operating on an Array type alias #1529

mario-bucev opened this issue May 17, 2024 · 0 comments · Fixed by #1531
Assignees

Comments

@mario-bucev
Copy link
Collaborator

The following code is rejected after extraction:

object ArrayTypeAlias {
  type ByteArray = Array[Byte]

  case class ByteArrayWrapper(ba: ByteArray)

  def test(baw: ByteArrayWrapper): Unit = {
    require(baw.ba.length == 64)
    baw.ba(0) = 3
    val ba2 = baw.ba.updated(0, 4.toByte)
    assert(ba2(0) == 4)
  }
}

Note that it seems to only concern Arrays, Set etc. are unaffected. The fix is easy but I'm opening the issue for tracking.

@mario-bucev mario-bucev self-assigned this May 17, 2024
mario-bucev added a commit to mario-bucev/stainless that referenced this issue May 17, 2024
mario-bucev added a commit to mario-bucev/stainless that referenced this issue May 17, 2024
@mario-bucev mario-bucev mentioned this issue May 17, 2024
mario-bucev added a commit to mario-bucev/stainless that referenced this issue May 17, 2024
mario-bucev added a commit to mario-bucev/stainless that referenced this issue May 17, 2024
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 a pull request may close this issue.

1 participant