Skip to content

Commit a04c098

Browse files
committed
Add a test from left over previous PR
Also: add another test that demonstrates some behavior relating to default parameters. Also: Rename a test so that we don't accidentally get the test file. In general, it's a bad idea to use a source file name in the compiler code for a test since we often get the wrong file when loading it into the editor.
1 parent 521432f commit a04c098

File tree

3 files changed

+12
-2
lines changed

3 files changed

+12
-2
lines changed

tests/pos-macros/i22584/Main.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import Types.*
1+
import types.*
22

33
@main def main() =
44
Macros.myMacro[MyClass1]

tests/pos-macros/i22584/Types.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
object Types {
1+
object types {
22
final case class MyClass1(
33
int: Int,
44
string: String,
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
case class Context(str: String)
2+
3+
def root(using Context): String = summon[Context].str
4+
5+
def narrow(using Context)(owner: String = root) = owner
6+
7+
given Context("alpha")
8+
9+
@main def Test = assert(narrow() == "alpha")
10+

0 commit comments

Comments
 (0)