Skip to content

Commit

Permalink
[ fix, re #3063 ] Fix forgotten reflection values
Browse files Browse the repository at this point in the history
  • Loading branch information
buzden authored and CodingCellist committed Dec 21, 2023
1 parent 58e5d15 commit 36132f6
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Core/Reflect.idr
Original file line number Diff line number Diff line change
Expand Up @@ -330,9 +330,9 @@ export
Reflect a => Reflect (WithDefault a def) where
reflect fc defs lhs env def
= onWithDefault
(appCon fc defs (reflectionttimp "Default") [Erased fc Placeholder, Erased fc Placeholder])
(appCon fc defs (reflectionttimp "DefaultedValue") [Erased fc Placeholder, Erased fc Placeholder])
(\x => do x' <- reflect fc defs lhs env x
appCon fc defs (reflectionttimp "Value") [Erased fc Placeholder, Erased fc Placeholder, x'])
appCon fc defs (reflectionttimp "SpecifiedValue") [Erased fc Placeholder, Erased fc Placeholder, x'])
def

export
Expand Down
15 changes: 15 additions & 0 deletions tests/idris2/reflection/reflection026/Issue3168.idr
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import Language.Reflection

%language ElabReflection

data_decl : List Decl
data_decl = `[data T = A | B]

record_decl : List Decl
record_decl = `[record R where]

data_decl' : List Decl
data_decl' = `[public export data T = A | B]

record_decl' : List Decl
record_decl' = `[public export record R where]
1 change: 1 addition & 0 deletions tests/idris2/reflection/reflection026/expected
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
1/1: Building Issue3168 (Issue3168.idr)
3 changes: 3 additions & 0 deletions tests/idris2/reflection/reflection026/run
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
. ../../../testutils.sh

check Issue3168.idr
1 change: 1 addition & 0 deletions tests/idris2/reflection/reflection026/test.ipkg
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
package a-test

0 comments on commit 36132f6

Please sign in to comment.