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

values in watch expressions should not be addable to codebase #4949

Open
kylegoetz opened this issue May 15, 2024 · 0 comments
Open

values in watch expressions should not be addable to codebase #4949

kylegoetz opened this issue May 15, 2024 · 0 comments

Comments

@kylegoetz
Copy link
Contributor

kylegoetz commented May 15, 2024

I found a way to inadvertently add a watch expression/statement to the codebase

Before describing how to replicate, I want to explain why I think it's the wrong behavior:

In a scratch file, put:

> y = 5

Now run add. No error, but if you clear out the scratch file and view y, you get The following names were not found in the codebase. Check your spelling. back in ucm.

Also, if you ls, y is nowhere to be found.

So far, this makes sense. Watch expressions are not addable to the codebase.

However, if you now put this into a scratch file:

> x = 5
test = do x

add will successfully add test even though it's dependent upon a watch expression.

If you ls or find x you will not find x. If you view test, you will see something like

test : 'Nat
test = do #k09e57l61r

and if you view the hash, you will get

#k09e57l61r : Nat
#k09e57l61r = 5

So the watch expression does get added to the codebase.

I expected add test to fail because it's reliant on something that shouldn't be added to the codebase.

This could be a problem if someone is using watch expressions to test code using credentials that shouldn't be added to the codebase. (I was investigating this behavior specifically because I thought I might be able to test a library using live credentials and put the private stuff in a watch expression to ensure it doesn't get added to the codebase (which is, once added, not removable).

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

No branches or pull requests

1 participant