-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Do now bind inline parameters when lifting args
Fixes #13411
- Loading branch information
1 parent
f8dec07
commit 5ac9f20
Showing
4 changed files
with
53 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
class Foo | ||
class Bar extends Foo | ||
|
||
inline def thingy(a: Int = 0, b: Int = 0, inline c: Foo = new Bar) = { | ||
inline c match { | ||
case _: Bar => | ||
} | ||
} | ||
|
||
def x = 1 | ||
|
||
def test = thingy(b = x) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
public class Constants { | ||
public static final int A = 0; | ||
public static final int B = 2; | ||
public static final int C = 3; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
class broken { | ||
sealed trait Foo | ||
case object A extends Foo | ||
case object B extends Foo | ||
case object C extends Foo | ||
case object D extends Foo | ||
|
||
inline def foo(inline f: Foo) = inline f match { | ||
case _: A.type => "the letter a" | ||
case _: B.type => "the letter b" | ||
case _: C.type => "the letter c" | ||
case _: D.type => "the letter d" | ||
} | ||
|
||
inline def thingy( | ||
depthClampEnable: Boolean = false, | ||
rasterizerDiscardEnable: Boolean = false, | ||
polygonMode: Int = 0, | ||
cullMode: Int = 0, | ||
frontFace: Int = 0, | ||
depthBiasEnable: Boolean = false, | ||
depthBiasConstantFactor: Float = 0, | ||
depthBiasClamp: Float = 0, | ||
depthBiasSlopeFactor: Float = 0, | ||
lineWidth: Float = 0, | ||
inline f: Foo = A, | ||
) = { | ||
foo(f) | ||
} | ||
|
||
thingy(polygonMode = Constants.A, cullMode = Constants.B, frontFace = Constants.C, lineWidth = 1.0f) | ||
} |