I don't understand. Can you show a code example?
Félix
> Le 6 janv. 2016 à 13:02:43, James Campbell via swift-evolution
> a écrit :
>
> I have a overloaded method for a protocol that takes an Int or double.
>
> I have an issue with swift calling the Int version
I have a overloaded method for a protocol that takes an Int or double.
I have an issue with swift calling the Int version when passing in a UInt32
. Ideally I would prefer the compiler to detect I am about to do something
which will cause an overflow and throw an error.
I would then have to
This is the full code:
//
// Box.swift
// Project
//
// Created by James Campbell on 06/01/2016.
//
//
// This File implements the Box protocol for Type Safe Alogrithm Types and
other useful things.
import Foundation
//MARK:- Box
protocol Box: CustomStringConvertible,
That last line, the value inside the Degree struct should be a Int created
from a UInt32
On Wed, Jan 6, 2016 at 7:08 PM, James Campbell wrote:
> This is the full code:
>
> //
>
> // Box.swift
>
> // Project
>
> //
>
> // Created by James Campbell on 06/01/2016.
>
> //
>
>
I either don't understand or can't reproduce the issue. This code:
> class Box {
> let value: Int
>
> init(value: Int) {
> self.value = value
> }
> }
>
> let test: UInt32 = 4
> let box = Box(value: test)
does not compile ("foo.swift:10:22: error: cannot