Skip to content

conflict between type annotations and type variables #325

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

Closed
olhotak opened this issue Jan 6, 2015 · 1 comment
Closed

conflict between type annotations and type variables #325

olhotak opened this issue Jan 6, 2015 · 1 comment

Comments

@olhotak
Copy link
Contributor

olhotak commented Jan 6, 2015

Consider the following code:

  type T = Int @a
  val x: T @b

What should be the effective annotation of the type of x? @a, @b, or both?

The first thing that Type.hasAnnotation(ClassSymbol) does is call stripTypeVar, so that loses @b. The current implementation of stripTypeVar throws away all annotations (so that it can find a typevar inside an AnnotatedType), so that loses @a as well. This implementation is clearly wrong (hasAnnotation ends up always returning false for every type), but what is the right (expected) behaviour? Should a typevar just accumulate all of the annotations of the types that it is instantiated with (@a @b in this example)?

@liufengyun
Copy link
Contributor

It is mentioned in #397 that this is fixed in #394.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants