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

Investigate suspicious cases of name parsing and processing #3479

Open
spcfox opened this issue Jan 26, 2025 · 0 comments
Open

Investigate suspicious cases of name parsing and processing #3479

spcfox opened this issue Jan 26, 2025 · 0 comments

Comments

@spcfox
Copy link
Contributor

spcfox commented Jan 26, 2025

Only simple UserName are parsed in binders, but more complex ones are allowed in some similar places. This leads to some strange behaviour. Examples:

Interface parameters

interface IfaceNS Name.Space.type where
  foo : Name.Space.type

IfaceNS Bool where
  foo = True

interface IfaceOp (<>) where
  bar : (<>)

IfaceOp Bool where
  bar = True

Data paremeters

data DataCaptaliseBool Bool = MkDataCaptaliseBool

foo : DataCaptaliseBool Bool
foo = MkDataCaptaliseBool

failing "Mismatch between: Type -> Type and Type"
  data DataCaptaliseList List = MkDataCaptaliseList

failing "Undefined name Name.Space.type"
  data DataNS Name.Space.type = MkDataNS

failing "Mismatch between: ?ty -> ?ty -> ?ty and Type"
  data DataOp (+) = MkDataOp

But in binders, capitalised names are allowed and namespaces and operators are forbidden:

data DataCaptalise : (List : Type) -> Type where
  MkDataCaptalise : DataCaptalise a

Record fields

record X where
  Name.Space.field : Type

foo : X -> Type
foo x = x.field
Main> :t field
Main.X.field : X -> Type
@spcfox spcfox changed the title Investigation of suspicious cases of name parsing and processing Investigate suspicious cases of name parsing and processing Jan 26, 2025
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