Skip to content

Commit

Permalink
Add custom args to pos tests
Browse files Browse the repository at this point in the history
  • Loading branch information
zeptometer committed Aug 18, 2023
1 parent 94a2dff commit 3b44c95
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions compiler/test/dotty/tools/dotc/CompilationTests.scala
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ class CompilationTests {
compileFilesInDir("tests/pos-scala2", scala2CompatMode),
compileFilesInDir("tests/pos-custom-args/captures", defaultOptions.and("-language:experimental.captureChecking")),
compileFilesInDir("tests/pos-custom-args/erased", defaultOptions.and("-language:experimental.erasedDefinitions")),
compileFilesInDir("tests/pos-custom-args/quoted-pattern-poly", defaultOptions.and("-language:experimental.quotedPatternsWithPolymorphicFunctions")),
compileFilesInDir("tests/pos", defaultOptions.and("-Ysafe-init")),
// Run tests for legacy lazy vals
compileFilesInDir("tests/pos", defaultOptions.and("-Ysafe-init", "-Ylegacy-lazy-vals", "-Ycheck-constraint-deps"), FileFilter.include(TestSources.posLazyValsAllowlist)),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@ import scala.quoted.*

def test(body: Expr[Any])(using Quotes): Expr[String] =
body match
case '{ [A] => (x : A, y : A) => (x, y) } => ???
// Bounded type parameters are allowed when they are not used in
// higher-order patterns
case '{ [A <: Iterable[Int]] => (x : A) => x } => ???
case '{ [A] => (x : A, y : A) => $b[A](x, y) : A } =>
'{ $b[String]("truthy", "falsy") }
case '{ [A, B] => (x : A, f : A => B) => $b[A, B](x, f) : B} =>
Expand Down

0 comments on commit 3b44c95

Please sign in to comment.