Skip to content

Commit

Permalink
add test case for unparameterized type instantiation
Browse files Browse the repository at this point in the history
  • Loading branch information
turbolent committed Apr 13, 2022
1 parent a296fab commit a50651a
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions runtime/tests/checker/genericfunction_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -922,3 +922,18 @@ func TestCheckBorrowOfCapabilityWithoutTypeArgument(t *testing.T) {

require.NoError(t, err)
}

func TestCheckUnparameterizedTypeInstantiationE(t *testing.T) {

t.Parallel()

_, err := ParseAndCheckWithPanic(t, `
struct S {}
let s: S<Int> = panic("")
`)

errs := ExpectCheckerErrors(t, err, 1)

assert.IsType(t, &sema.UnparameterizedTypeInstantiationError{}, errs[0])
}

0 comments on commit a50651a

Please sign in to comment.