[SR-525] AnyObject unresolved dot expr fails oddly and intermittently #43142
Labels
bug
A deviation from expected or documented behavior. Also: expected but undesirable behavior.
compiler
The Swift compiler in itself
type checker
Area → compiler: Semantic analysis
Environment
Swift version 2.2-dev (LLVM 3ebdbb2c7e, Clang f66c5bb67b, Swift 85231a2)
Target: x86_64-apple-macosx10.9
Additional Detail from JIRA
md5: 8c50fc5d55b963182e98f665a18862a0
relates to:
Issue Description:
Description:
When refactoring test cases, unresolved dot expr seems as if it's not typechecking properly. Swift reports an error message that doesn't seem to make sense. Sometime the type checking succeeds by including top level expressions that don't appear to affect the statement in question.
Inputs:
Replace swift/validation-test/stdlib/Dictionary.swift with the following content:
Then run this test case using lit, for example:
It results in the error message:
where the underscore appears to be a type variable.
Uncommenting the empty delete chain collision test case causes this test case to pass like so:
This is odd because that statement should have no affect on the typing of other code in the module, but it appears to.
Results while minimizing this example oscillate back and forth between working and not. This is the smallest that I seem to easily be able to make this. Making it smaller still produces a version that consistently fails with the provided error message. Minimizing it even more produces an entirely different error message, which is reported in SR-524.
The text was updated successfully, but these errors were encountered: