[SR-177] Swift does not report a type error at compile-time -- program crashes at runtime instead #42799
Labels
bug
A deviation from expected or documented behavior. Also: expected but undesirable behavior.
compiler
The Swift compiler itself
type checker
Area → compiler: Semantic analysis
Environment
The swift binary ("swift build") from Xcode Swift 2.2 Snapshot, December 1, 2015.
OS X 10.11.2.
Additional Detail from JIRA
md5: 66f3b25f0cbbb2f3a680f50012948c63
Issue Description:
Problem:
This code (all in main.swift) crashes at runtime at the line indicated:
Solution:
As expected, if I turn the crashing line into the following line, things work properly again:
Expected behavior:
The compiler should have shown a compile-time error as "d1 - d2" is meaningless because there is no "-" operator implemented for the DoubleProtocol.
The text was updated successfully, but these errors were encountered: