Skip to content

the first public draft of the inline/meta SIP #530

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
wants to merge 1 commit into from
Closed

the first public draft of the inline/meta SIP #530

wants to merge 1 commit into from

Conversation

xeno-by
Copy link
Contributor

@xeno-by xeno-by commented May 23, 2016


The previous rule of regarding a `final val` with no explicit type as
a compile-time constant (inherited from Java) is dropped. Instead we
write such `val`s now as `inline`.
Copy link
Member

@dwijnand dwijnand Jun 24, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please note that another thing that final val does is make its type more precise:

Welcome to Scala 2.11.8 (Java HotSpot(TM) 64-Bit Server VM, Java 1.8.0_92).
Type in expressions for evaluation. Or try :help.

scala> val x = 1
x: Int = 1

scala> final val x = 1
x: Int(1) = 1

So you would be throwing that out as well..

@xeno-by
Copy link
Contributor Author

xeno-by commented Aug 11, 2016

I am retracting this draft from public discussion.

Over the last few months, I have created an extensive description of the new macro system, expanding on the points briefly touched in this pull request and filling in the blanks. Before the end of this month, I will finish the proposal and post it as a pre-SIP at the scala-sips mailing list, as required by the new process (http://docs.scala-lang.org/sips/sip-submission.html). I will also post a link to the new discussion here.

@acdenhartog @dwijnand Thank you for your feedback. It has been addressed in the new write-up.

@xeno-by xeno-by closed this Aug 11, 2016
@xeno-by
Copy link
Contributor Author

xeno-by commented Aug 22, 2016

I have just published a follow-up proposal at https://gist.github.com/xeno-by/9d7a709b1ba7c2ee64cfedcc5d264bd5. In order to centralize the discussion, post your questions, feedback and ideas to http://gitter.im/scalameta/sips.

@odersky
Copy link
Contributor

odersky commented Sep 12, 2016

@axel22 Dotty's implementation of SIPs knows about the position in the inlined method and in the call. For example, here's a typical error message:

C_1.scala:5: error: class D in package p cannot be accessed
    val d = new D()     // error (when inlined): not accessible
                ^

... this location is in code that was inlined at Test_2.scala:5:

    c.inl()
         ^
one error found
@axel22
Copy link
Contributor

axel22 commented Sep 15, 2016

@odersky That looks great. I'm looking forward to trying it out!

bishabosha pushed a commit to bishabosha/docs.scala-lang that referenced this pull request Mar 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
4 participants