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

Repeated Type is allowed in a type alias. Subsequent usage in parameter list crashes the compiler. #3180

Closed
scabug opened this issue Mar 15, 2010 · 3 comments
Assignees

Comments

@scabug
Copy link

scabug commented Mar 15, 2010

scala> type VarArgs =  (Any*)
defined type alias VarArgs

scala> def foo(v: VarArgs) = 0
Exception in thread "main" scala.MatchError: $$iw.$$iw.VarArgs
        at scala.tools.nsc.typechecker.RefChecks$$RefCheckTransformer.varargBridg
e$$1(RefChecks.scala:126)
        at 

I think it should be prevented in the same as a by-name params:

scala> type LazyString = (=> String)
<console>:1: error: no by-name parameter type allowed here
       type LazyString = (=> String)
@scabug
Copy link
Author

scabug commented Mar 15, 2010

Imported From: https://issues.scala-lang.org/browse/SI-3180?orig=1
Reporter: @retronym

@scabug
Copy link
Author

scabug commented Mar 15, 2010

@scabug
Copy link
Author

scabug commented Mar 16, 2010

@odersky said:
(In r21189) Closes #3180. No review.

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