Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: generate fixups for static abstracts #16193

Closed
wants to merge 1 commit into from
Closed

Fix: generate fixups for static abstracts #16193

wants to merge 1 commit into from

Conversation

gusty
Copy link
Contributor

@gusty gusty commented Oct 27, 2023

Fixes #15919 (thanks @vzarytovskii for the detailed research)

TODO: add tests, find out other open issues that might be fixed by this

@vzarytovskii
Copy link
Member

Probably need to test variable implementation depth, with only one implementation (it might be already covered by existing tests when IWSAMs were introduced).

@En3Tho If you'll have any suitable test cases, that'd be great.

@En3Tho
Copy link
Contributor

En3Tho commented Oct 27, 2023

Sure: implementing an INumber<T>. I guess this is more or less real world example and covers IL import too.

type MyNumber() =
    interface INumber<MyNumber> with
        static member ( % )(left, right) = failwith "todo"
        static member ( * )(left, right) = failwith "todo"
        static member ( + )(left, right) = failwith "todo"
        static member ( - )(left, right) = failwith "todo"
        static member ( / )(left, right) = failwith "todo"
        static member ( < )(left, right) = failwith "todo"
        static member ( <= )(left, right) = failwith "todo"
        static member ( <> )(left, right) = failwith "todo"
        static member ( = )(left, right) = failwith "todo"
        static member ( > )(left, right) = failwith "todo"
        static member ( >= )(left, right) = failwith "todo"
        static member ( ~+ )(value) = failwith "todo"
        static member op_Increment (value) = failwith "todo"
        static member ( ~- )(value) = failwith "todo"
        static member op_Decrement (value) = failwith "todo"
        static member Abs(value) = failwith "todo"
        static member Clamp(value, min, max) = failwith "todo"
        static member CompareTo(obj: obj): int = failwith "todo"
        static member CompareTo(other: MyNumber): int = failwith "todo"
        static member CopySign(value, sign) = failwith "todo"
        static member CreateChecked(value) = failwith "todo"
        static member CreateSaturating(value) = failwith "todo"
        static member CreateTruncating(value) = failwith "todo"
        static member Equals(other) = failwith "todo"
        static member IsCanonical(value) = failwith "todo"
        static member IsComplexNumber(value) = failwith "todo"
        static member IsEvenInteger(value) = failwith "todo"
        static member IsFinite(value) = failwith "todo"
        static member IsImaginaryNumber(value) = failwith "todo"
        static member IsInfinity(value) = failwith "todo"
        static member IsInteger(value) = failwith "todo"
        static member IsNaN(value) = failwith "todo"
        static member IsNegative(value) = failwith "todo"
        static member IsNegativeInfinity(value) = failwith "todo"
        static member IsNormal(value) = failwith "todo"
        static member IsOddInteger(value) = failwith "todo"
        static member IsPositive(value) = failwith "todo"
        static member IsPositiveInfinity(value) = failwith "todo"
        static member IsRealNumber(value) = failwith "todo"
        static member IsSubnormal(value) = failwith "todo"
        static member IsZero(value) = failwith "todo"
        static member Max(x, y) = failwith "todo"
        static member MaxMagnitude(x, y) = failwith "todo"
        static member MaxMagnitudeNumber(x, y) = failwith "todo"
        static member MaxNumber(x, y) = failwith "todo"
        static member Min(x, y) = failwith "todo"
        static member MinMagnitude(x, y) = failwith "todo"
        static member MinMagnitudeNumber(x, y) = failwith "todo"
        static member MinNumber(x, y) = failwith "todo"
        static member Parse(s: System.ReadOnlySpan<char>, style: System.Globalization.NumberStyles, provider: System.IFormatProvider): MyNumber = failwith "todo"
        static member Parse(s: string, style: System.Globalization.NumberStyles, provider: System.IFormatProvider): MyNumber = failwith "todo"
        static member Parse(s: System.ReadOnlySpan<char>, provider: System.IFormatProvider): MyNumber = failwith "todo"
        static member Parse(s: string, provider: System.IFormatProvider): MyNumber = failwith "todo"
        static member Sign(value) = failwith "todo"
        static member ToString(format, formatProvider) = failwith "todo"
        static member TryConvertFromChecked(value, result) = failwith "todo"
        static member TryConvertFromSaturating(value, result) = failwith "todo"
        static member TryConvertFromTruncating(value, result) = failwith "todo"
        static member TryConvertToChecked(value, result) = failwith "todo"
        static member TryConvertToSaturating(value, result) = failwith "todo"
        static member TryConvertToTruncating(value, result) = failwith "todo"
        static member TryFormat(destination, charsWritten, format, provider) = failwith "todo"
        static member TryParse(s: System.ReadOnlySpan<char>, style: System.Globalization.NumberStyles, provider: System.IFormatProvider, result: byref<MyNumber>): bool = failwith "todo"
        static member TryParse(s: string, style: System.Globalization.NumberStyles, provider: System.IFormatProvider, result: byref<MyNumber>): bool = failwith "todo"
        static member TryParse(s: System.ReadOnlySpan<char>, provider: System.IFormatProvider, result: byref<MyNumber>): bool = failwith "todo"
        static member TryParse(s: string, provider: System.IFormatProvider, result: byref<MyNumber>): bool = failwith "todo"
        static member AdditiveIdentity = failwith "todo"
        static member MultiplicativeIdentity = failwith "todo"
        static member One = failwith "todo"
        static member Radix = failwith "todo"
        static member Zero = failwith "todo"
        static member op_CheckedAddition(left, right) = failwith "todo"
        static member op_CheckedDecrement(value) = failwith "todo"
        static member op_CheckedDivision(left, right) = failwith "todo"
        static member op_CheckedIncrement(value) = failwith "todo"
        static member op_CheckedMultiply(left, right) = failwith "todo"
        static member op_CheckedSubtraction(left, right) = failwith "todo"
        static member op_CheckedUnaryNegation(value) = failwith "todo"

@gusty gusty closed this by deleting the head repository Oct 27, 2023
@gusty
Copy link
Contributor Author

gusty commented Oct 27, 2023

Replaced by #16195

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: New
Development

Successfully merging this pull request may close these issues.

Build fails with Error FS2014, error: MethodDef not found when using static abstract stuff
3 participants