Bug: Cannot construct a value of type: PlutusTx.Builtins.Internal.BuiltinUnit#7162
Merged
Bug: Cannot construct a value of type: PlutusTx.Builtins.Internal.BuiltinUnit#7162
Cannot construct a value of type: PlutusTx.Builtins.Internal.BuiltinUnit#7162Conversation
Contributor
|
97d926e to
07b20e0
Compare
07b20e0 to
da0e24d
Compare
da0e24d to
9e42a6c
Compare
SeungheonOh
reviewed
Jul 25, 2025
Collaborator
SeungheonOh
left a comment
There was a problem hiding this comment.
I prefer adding special handling for providing better error message instead of disabling simplpass entirely. It seems writing a new simplifier(or rather, unfolder) would require some changes to GHC itself which would be undesirable.
f1c28f3 to
81f5a8c
Compare
Contributor
7ed86ac to
7153af2
Compare
7153af2 to
9b30fe7
Compare
9b30fe7 to
523d394
Compare
523d394 to
2e71ed8
Compare
2e71ed8 to
cfb073f
Compare
cfb073f to
72a3af0
Compare
72a3af0 to
e8748f5
Compare
041e264 to
07882eb
Compare
zliu41
approved these changes
Feb 5, 2026
Add detection of opaque builtin types (BuiltinUnit, BuiltinData, etc.) from PlutusTx.Builtins.Internal and provide actionable guidance when users hit "Cannot construct a value of type" errors. These errors typically occur when where-bindings inside compile quotations trigger stage violations. The improved messages explain the cause and suggest moving bindings to top-level.
Exercise the improved error messages for various opaque builtin types: BuiltinUnit, BuiltinData, BuiltinByteString, BuiltinString, BuiltinList. Includes positive test for BuiltinInteger (type alias, not opaque). Uses context-level=0 to avoid package hash mismatches between local and CI builds in golden file output.
Add troubleshooting section explaining why where-bindings inside compile quotations fail with 'Cannot construct a value of type' errors. Provides concrete before/after code examples showing how to move bindings to top-level.
46d578b to
bb27adf
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes https://github.com/IntersectMBO/plutus-private/issues/1626