Commit Graph

4 Commits

Author SHA1 Message Date
Slava Pestov
5808d9beb9 Parse: Remove parse-time name lookup 2020-11-16 22:39:44 -05:00
Slava Pestov
6a5684a76c Sema: Allow duplicate internal parameter names on protocol requirements
This fixes a recent source compatibility regression.

Fixes <rdar://problem/70445751>.
2020-10-19 16:02:14 -04:00
Slava Pestov
6042784578 Sema: Tweak re-declaration checking behavior to match old logic
The parser's own re-declaration checking for local declarations has
slightly different behavior than Sema's re-declaration check.

Whereas Sema rejects this:

class C {
  let x = 123
  func x() {}
}

The parser accepts this:

func f() {
  let x = 123
  func x() {}
}

With Sema's check now handling both cases, fudge the behavior to
match the parser in the local case.
2020-10-01 23:46:26 -04:00
Slava Pestov
18f5f94ce2 Sema: Check for duplicate parameter and generic parameter names when parser lookup is off
The existing redeclaration checking can be extended for declarations in
local scope, but it won't catch these.
2020-09-29 23:38:24 -04:00