-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: type check default values of parameters
- Loading branch information
1 parent
070ad8b
commit 72a9bbf
Showing
1 changed file
with
19 additions
and
0 deletions.
There are no files selected for viewing
19 changes: 19 additions & 0 deletions
19
...ang/tests/resources/validation/types/checking/default values/with type parameters.sdstest
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,19 @@ | ||
package tests.validation.types.checking.defaultValues | ||
|
||
class SomeClass<T1, T2 sub Number>( | ||
// $TEST$ no error r"Expected type .* but got .*\." | ||
p1: T1 = »true«, | ||
// $TEST$ no error r"Expected type .* but got .*\." | ||
p2: T1 = »1«, | ||
// $TEST$ error "Expected type 'T2' but got 'literal<"">'." | ||
p3: T2 = »""«, | ||
) | ||
|
||
fun someFunction<T1, T2 sub Number>( | ||
// $TEST$ no error r"Expected type .* but got .*\." | ||
p1: T1 = »true«, | ||
// $TEST$ no error r"Expected type .* but got .*\." | ||
p2: T1 = »1«, | ||
// $TEST$ error "Expected type 'T2' but got 'literal<"">'." | ||
p3: T2 = »""«, | ||
) |