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

The inherent type of the array value of byte-array-literal created is not byte[N] #32542

Closed
lochana-chathura opened this issue Sep 2, 2021 · 1 comment · Fixed by #37326
Closed
Assignees
Labels
Area/Compiler Error/TypeK correct program, gets "this program is wrong" error at compile time Lang/Expressions/Literal Points/3 Equivalent to three days effort Reason/EngineeringMistake The issue occurred due to a mistake made in the past. Team/CompilerFE All issues related to Language implementation and Compiler, this exclude run times. Type/Bug
Milestone

Comments

@lochana-chathura
Copy link
Member

lochana-chathura commented Sep 2, 2021

Description:
Spec says,

The static type of byte-array-literal is byte[N], where N is the number of bytes encoded by the Base16Literal or Base64Literal. The inherent type of the array value created is also byte[N].

Consider following sample

io:println(base16 `aa bb` is byte[2]);  // output should be true
byte[2] byteArray1 = base16 `aa bb`; // gives the error incompatible types: expected 'byte[2]', found 'byte[]'
byte[*] byteArray2 = base16 `aa bb`; // gives the error incompatible types: expected 'byte[*]', found 'byte[]'
@lochana-chathura lochana-chathura added Type/Bug Area/Compiler Team/CompilerFE All issues related to Language implementation and Compiler, this exclude run times. labels Sep 2, 2021
@lochana-chathura lochana-chathura changed the title The inherent type of the array value of byte-array-literal created is not byte[N] The inherent type of the array value of byte-array-literal created is not byte[N] Sep 2, 2021
@lochana-chathura lochana-chathura added Error/TypeK correct program, gets "this program is wrong" error at compile time Lang/Expressions/Literal labels Sep 16, 2021
@gimantha gimantha added this to All issues in Spec Conformance Bug Fix via automation Oct 6, 2021
@gimantha gimantha moved this from All issues to XML in Spec Conformance Bug Fix Oct 6, 2021
@gimantha gimantha moved this from XML to Arrays in Spec Conformance Bug Fix Oct 6, 2021
@pcnfernando pcnfernando added the Points/3 Equivalent to three days effort label Jul 27, 2022
@lasinicl lasinicl moved this from Planned for this Sprint to In Progress in Sprint 61 - Compiler Frontend, Integration and Parser Aug 3, 2022
@MaryamZi MaryamZi added this to the 2201.3.0 milestone Sep 23, 2022
Spec Conformance Bug Fix automation moved this from Arrays to Done Sep 29, 2022
@github-actions
Copy link

This issue is NOT closed with a proper Reason/ label. Make sure to add proper reason label before closing. Please add or leave a comment with the proper reason label now.

      - Reason/EngineeringMistake - The issue occurred due to a mistake made in the past.
      - Reason/Regression - The issue has introduced a regression.
      - Reason/MultipleComponentInteraction - Issue occured due to interactions in multiple components.
      - Reason/Complex - Issue occurred due to complex scenario.
      - Reason/Invalid - Issue is invalid.
      - Reason/Other - None of the above cases.

@gimantha gimantha added the Reason/EngineeringMistake The issue occurred due to a mistake made in the past. label Sep 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area/Compiler Error/TypeK correct program, gets "this program is wrong" error at compile time Lang/Expressions/Literal Points/3 Equivalent to three days effort Reason/EngineeringMistake The issue occurred due to a mistake made in the past. Team/CompilerFE All issues related to Language implementation and Compiler, this exclude run times. Type/Bug
Development

Successfully merging a pull request may close this issue.

5 participants