fun nested() { fun foo() {} fun foo() {} ; } fun nested() {} class Bar {} class Bar {} // @expect-errors: // | __test__:3:2: duplicate definition of function 'foo' // | __test__:8:0: duplicate definition of function 'nested' // | __test__:11:0: duplicate definition of class 'Bar'