-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Fix macros with array parameters #4567
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
Merged
nicolasstucki
merged 2 commits into
scala:master
from
dotty-staging:fix-macro-array-params
May 23, 2018
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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,34 @@ | ||
|
||
object Macro { | ||
|
||
inline def foo0(i: Int): Unit = ~{ '() } | ||
inline def foo1(arr: Array[Boolean]): Unit = ~{ '() } | ||
inline def foo2(arr: Array[Byte]): Unit = ~{ '() } | ||
inline def foo3(arr: Array[Short]): Unit = ~{ '() } | ||
inline def foo4(arr: Array[Int]): Unit = ~{ '() } | ||
inline def foo5(arr: Array[Long]): Unit = ~{ '() } | ||
inline def foo6(arr: Array[Float]): Unit = ~{ '() } | ||
inline def foo7(arr: Array[Double]): Unit = ~{ '() } | ||
inline def foo8(arr: Array[Char]): Unit = ~{ '() } | ||
inline def foo9(arr: Array[Object]): Unit = ~{ '() } | ||
inline def foo10(arr: Array[String]): Unit = ~{ '() } | ||
inline def foo11[T](arr: Array[T]): Unit = ~{ '() } | ||
inline def foo12(arr: Array[Array[Int]]): Unit = ~{ '() } | ||
inline def foo13(arr: Array[Array[String]]): Unit = ~{ '() } | ||
inline def foo14(arr: Array[Array[Array[Int]]]): Unit = ~{ '() } | ||
inline def foo15(arr: Array[Any]): Unit = ~{ '() } | ||
inline def foo16(arr: Array[AnyVal]): Unit = ~{ '() } | ||
inline def foo17(arr: Array[AnyRef]): Unit = ~{ '() } | ||
inline def foo18(arr: Array[Foo]): Unit = ~{ '() } | ||
inline def foo19(arr: Array[Macro.type]): Unit = ~{ '() } | ||
inline def foo20(arr: Array[Bar]): Unit = ~{ '() } | ||
inline def foo21(arr: Array[Baz.type]): Unit = ~{ '() } | ||
inline def foo22(arr: Array[Foo#A]): Unit = ~{ '() } | ||
|
||
class Bar | ||
object Baz | ||
} | ||
|
||
class Foo { | ||
class A | ||
} |
This file contains hidden or 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,25 @@ | ||
object PowerInlined1 { | ||
Macro.foo0(2) | ||
Macro.foo1(Array.empty) | ||
Macro.foo2(Array.empty) | ||
Macro.foo3(Array.empty) | ||
Macro.foo4(Array.empty) | ||
Macro.foo5(Array.empty) | ||
Macro.foo6(Array.empty) | ||
Macro.foo7(Array.empty) | ||
Macro.foo8(Array.empty) | ||
Macro.foo9(Array.empty) | ||
Macro.foo10(Array.empty) | ||
Macro.foo11[String](Array.empty) | ||
Macro.foo12(Array.empty) | ||
Macro.foo13(Array.empty) | ||
Macro.foo14(Array.empty) | ||
Macro.foo15(Array.empty) | ||
Macro.foo16(Array.empty) | ||
Macro.foo17(Array.empty) | ||
Macro.foo18(Array.empty) | ||
Macro.foo19(Array.empty) | ||
Macro.foo20(Array.empty) | ||
Macro.foo21(Array.empty) | ||
Macro.foo22(Array.empty) | ||
} |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess this should remain commented-out and not removed, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, in case we need it for something else again. It was really useful the first time.