Skip to content

Commit 7c758cc

Browse files
authored
Merge pull request #4 from EdBarrancos/2-erase-warning
Remove Int as a builtin type
2 parents bc29f0f + 6fb6149 commit 7c758cc

2 files changed

Lines changed: 9 additions & 5 deletions

File tree

src/JOSPreDefinitions/BuiltInTypes.jl

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,17 @@ export _Exception, _TypeException, _IO,
88
@defbuiltin _TypeException(Type{Exception})
99
@defbuiltin _IO(IO)
1010

11+
@defclass(_Int, [Top], [], metaclass=BuiltInClass)
12+
1113
@defbuiltin _Int8(Int8)
1214
@defbuiltin _Int16(Int16)
13-
@defbuiltin _Int32(Int32)
14-
@defbuiltin _Int64(Int64)
1515
@defbuiltin _Int128(Int128)
1616

17-
@defbuiltin _Int(Int)
17+
@defclass(_Int32, [_Int], [], metaclass=BuiltInClass)
18+
class_of(instance::Int32) = _Int32
19+
20+
@defclass(_Int64, [_Int], [], metaclass=BuiltInClass)
21+
class_of(instance::Int64) = _Int64
1822

1923
@defbuiltin _Bool(Bool)
2024

test/test_built_in_classes.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ using Test
33

44
@testset "Built-In Classes" begin
55
@testset "Print object" begin
6-
result = @capture_out show(class_of(1))
7-
@test result == "<BuiltInClass _Int>"
6+
result = @capture_out show(class_of(Int64(1)))
7+
@test result == "<BuiltInClass _Int64>"
88

99
result = @capture_out show(class_of("Foo"))
1010
@test result == "<BuiltInClass _String>"

0 commit comments

Comments
 (0)