Add `inline` changes semantics
See original GitHub issueCompiler version
master
Minimized code
class A(val x: Int):
class X:
inline def foo() = A.this.foo() // remove inline changes semantics
private def foo(): Unit = println(x)
class B extends A(20):
val a = new A(10)
val y: Y = new Y
class Y extends a.X
class C:
var b = new B
b.y.foo() // should print 10, but prints 20
@main
def test = new C()
Output
20
Expectation
It should print 10, but it prints 20.
Initial Diagnosis
The problem seems to be related to the encoding of outer-select in inlining. The example above seems to suggest that hops alone is ambiguous.
Issue Analytics
- State:
- Created a year ago
- Comments:10 (8 by maintainers)
Top Results From Across the Web
Inline elements - HTML: HyperText Markup Language | MDN
In this article, we'll examine HTML inline-level elements and how they differ from block-level elements.
Read more >Copyediting with Semantic HTML | CSS-Tricks
Tracking changes is a quintessential copyediting feature for comparing versions of content. While we're used to tracking changes in a word ...
Read more >About inline markup in the semantic cli
An inline class will always create a span element internally. So in themes, you can use the span.emph CSS selector to change how...
Read more >Inline semantics - Free tutorial to learn HTML and CSS
3.3 Inline semantics ... You can add a title attribute to specify the abbreviation's description, which will appear by hovering the element:.
Read more >Inline Styles in HTML - Codecademy
CSS is built to style that structured information. When inline styles are used, this clear separation between structured information and styling is blurred....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
When we inline the code we probably need to find the references to the outer
this
references and adapt them to the inline binding in the scope where they are inlined. Use-Xprint:inlining
.I see we get this
We should first try to:
A_this
, or in general what code should be generatedThe PR seems viable. I was coming back to this to ask: seeing
b
isn’t stable, is inlining off of a non-stable path meant to work? I only noticed because you can’t call new on it (val y: Y = new b.Y
).