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

Sequence comprehension and Type descriptors issue #5065

Closed
MikaelMayer opened this issue Feb 7, 2024 · 0 comments · Fixed by #5066
Closed

Sequence comprehension and Type descriptors issue #5065

MikaelMayer opened this issue Feb 7, 2024 · 0 comments · Fixed by #5066
Labels
during 2: compilation of correct program Dafny rejects a valid program during compilation kind: bug Crashes, unsoundness, incorrect output, etc. If possible, add a `part:` label

Comments

@MikaelMayer
Copy link
Member

MikaelMayer commented Feb 7, 2024

Dafny version

latest-nightly

Code to produce this issue

const TWO_TO_THE_8: int := 0x100
newtype uint8 = x: int | 0 <= x < TWO_TO_THE_8

method Main() {
  var i: uint8 := 10;
  var s: seq<uint8> := seq(i, _ => 0);
  print s;
}

Command to run and resulting output

dafny run -t:java Example.dfy


error: method Create in class DafnySequence<T#2> cannot be applied to given types;
    _1_s = dafny.DafnySequence.Create(uint8._typeDescriptor(), _0_i, ((java.util.function.Function<java.math.BigInteger, java.lang.Byte>)(_2___v0_boxed0) -> {

What happened?

Compilation fails

Related: #3952

What type of operating system are you experiencing the problem on?

Windows

@MikaelMayer MikaelMayer added kind: bug Crashes, unsoundness, incorrect output, etc. If possible, add a `part:` label during 2: compilation of correct program Dafny rejects a valid program during compilation labels Feb 7, 2024
MikaelMayer added a commit that referenced this issue Feb 7, 2024
@robin-aws robin-aws assigned robin-aws and unassigned robin-aws Feb 7, 2024
robin-aws added a commit that referenced this issue Feb 7, 2024
)

This PR fixes #5065
I added the corresponding test.

<small>By submitting this pull request, I confirm that my contribution
is made under the terms of the [MIT
license](https://github.com/dafny-lang/dafny/blob/master/LICENSE.txt).</small>

---------

Co-authored-by: Robin Salkeld <salkeldr@amazon.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
during 2: compilation of correct program Dafny rejects a valid program during compilation kind: bug Crashes, unsoundness, incorrect output, etc. If possible, add a `part:` label
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants