-
Notifications
You must be signed in to change notification settings - Fork 59
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
Constructors of the same name confuse Agda #5
Comments
If anyone is interested, this problem is being caused by the definition of truncation level: data TLevel : Type₀ where The use of S for succ is confusing Agda. Perhaps consider renaming this S to STLevel or sucT for example... the occasional highlighting errors it causes can be very distracting! |
In the meantime, you can use the following instead of open import HoTT hiding (module TLevel)
open TLevel renaming (S to sucT) |
@aerskine Sorry that I wasn't very responsive. One reason is that I am not personally using Emacs mode and was waiting for others. Does this always happen with the constructors with the same name? I thought Agda will fully parse the whole file before highlighting it, which means that this could be an Agda bug. Did I miss something here? |
@aerskine @pthariensflame Hi, I am wondering if newer Agda renders the overloaded constructors correctly. Personally I am not using Emacs so I need feedback from you. Thanks. |
I'm using Emacs and I just tried out the sample linked to in the report and see the same behavior with Agda 2.5.1.1. Commenting out the imports and replacing them with the commented lines doesn't work though; it complains "Duplicate binding for built-in thing LEVEL, previous binding to .Agda.Primitive.Level" |
I feel this issue is lingering for too long so I installed Emacs for myself to see what is going on. This is not about highlighting at all---the code simply fails to compile because Agda is unable to resolve @mikeshulman The error message is due to a recent change in Agda. Here is a self-contained fragment that exposes the issue. data _==_ {A : Set} (a : A) : A → Set where
idp : a == a
data ℕ : Set where
O : ℕ
S : (n : ℕ) → ℕ
data TLevel : Set where
⟨-2⟩ : TLevel
S : (n : TLevel) → TLevel
S= : {m n : ℕ} → m == n → S m == S n
S= idp = idp |
I get a lot of confusing yellow highlighting when using HoTT-Agda, which I initially ascribed to inability on my part, but have now reduced to a simple example which has left me just as confused, yet not so assured of my guilt:
https://gist.github.com/aerskine/7962608
When I load this file with Agda 2.3.2.1 the S m == S n term is highlighted yellow, with missing metadata as indicated in the comments.
However, upon commenting out the import statements and replacing with the cut / pasted code from HoTT-Agda the problem vanishes.
The text was updated successfully, but these errors were encountered: