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

punning doesn't work in presence of :~ or :: #494

Open
sorawee opened this issue Mar 30, 2024 · 1 comment
Open

punning doesn't work in presence of :~ or :: #494

sorawee opened this issue Mar 30, 2024 · 1 comment

Comments

@sorawee
Copy link
Contributor

sorawee commented Mar 30, 2024

This is OK:

#lang rhombus

fun foo(~x):
  x

This is not OK:

#lang rhombus

fun foo(~x :: Number):
  x

which produces the error:

#%literal: not an allowed literal term in: ~x
@sorawee sorawee changed the title punning doesn't work in presence of ~: or :: punning doesn't work in presence of :~ or :: Mar 30, 2024
@usaoc
Copy link
Collaborator

usaoc commented Mar 31, 2024

I see why one would want to do this, but I’m not sure adding yet more special cases is the best idea—function headers already have a rather sugary grammar as is.

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

2 participants